Skip to content

Commit 5f659dc

Browse files
committed
Move container_registry metrics from beats to integrations
Switch from "container_registry" to "monitor" metricset, add the metrics configuration from beats, and add an ingest pipeline to set the expected field names (`container_registry.*` instead of `azure.metrics.*`).
1 parent 7a78c79 commit 5f659dc

File tree

4 files changed

+56
-3
lines changed

4 files changed

+56
-3
lines changed

packages/azure_metrics/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
- version: "1.0.8"
2+
changes:
3+
- description: Move container_registry metrics config from beats to integrations
4+
type: enhancement
5+
link: https://github.com/elastic/integrations/pull/3629
16
- version: "1.0.7"
27
changes:
38
- description: Move container_service metrics config from beats to integrations

packages/azure_metrics/data_stream/container_registry/agent/stream/stream.yml.hbs

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
metricsets: ["container_registry"]
1+
metricsets: ["monitor"]
22
period: {{period}}
33
{{#if client_id}}
44
client_id: {{client_id}}
@@ -26,10 +26,44 @@ resources:
2626
{{#if resource_groups}}
2727
{{#each resource_groups}}
2828
- resource_group: "{{this}}"
29+
resource_type: "Microsoft.ContainerRegistry/registries"
30+
metrics:
31+
- name: ["TotalPullCount", "SuccessfulPullCount", "TotalPushCount", "SuccessfulPushCount","RunDuration", "AgentPoolCPUTime"]
32+
namespace: "Microsoft.ContainerRegistry/registries"
33+
timegrain: "PT5M"
34+
- name: ["StorageUsed"]
35+
namespace: "Microsoft.ContainerRegistry/registries"
36+
timegrain: "PT1H"
2937
{{/each}}
3038
{{/if}}
3139
{{#if resource_ids}}
3240
{{#each resource_ids}}
3341
- resource_id: "{{this}}"
42+
timegrain: "PT5M"
43+
metrics:
44+
- name: ["TotalPullCount", "SuccessfulPullCount", "TotalPushCount", "SuccessfulPushCount","RunDuration", "AgentPoolCPUTime"]
45+
namespace: "Microsoft.ContainerRegistry/registries"
46+
timegrain: "PT5M"
47+
- name: ["StorageUsed"]
48+
namespace: "Microsoft.ContainerRegistry/registries"
49+
timegrain: "PT1H"
3450
{{/each}}
35-
{{/if}}
51+
{{/if}}
52+
53+
{{!
54+
When no resource group and resource ID are specified by the user, we want to
55+
collect metrics for all the resource groups in the subscription.
56+
}}
57+
58+
{{#unless resource_ids }}
59+
{{#unless resource_groups }}
60+
- resource_query: "resourceType eq 'Microsoft.ContainerRegistry/registries'"
61+
metrics:
62+
- name: ["TotalPullCount", "SuccessfulPullCount", "TotalPushCount", "SuccessfulPushCount","RunDuration", "AgentPoolCPUTime"]
63+
namespace: "Microsoft.ContainerRegistry/registries"
64+
timegrain: "PT5M"
65+
- name: ["StorageUsed"]
66+
namespace: "Microsoft.ContainerRegistry/registries"
67+
timegrain: "PT1H"
68+
{{/unless}}
69+
{{/unless}}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
description: Pipeline for parsing azure container_registry metrics.
3+
processors:
4+
- set:
5+
field: ecs.version
6+
value: "8.0.0"
7+
- rename:
8+
field: azure.metrics
9+
target_field: azure.container_registry
10+
ignore_missing: true
11+
on_failure:
12+
- set:
13+
field: error.message
14+
value: '{{ _ingest.on_failure_message }}'

packages/azure_metrics/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: azure_metrics
22
title: Azure Resource Metrics
3-
version: 1.0.7
3+
version: 1.0.8
44
release: ga
55
description: Collect metrics from Azure resources with Elastic Agent.
66
type: integration

0 commit comments

Comments
 (0)