Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model: Align labels field with ECS #6633

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apmpackage/apm/data_stream/app_metrics/fields/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@
name: host.name
- external: ecs
name: host.os.platform
# TODO: change labels to be ECS compliant in 8.0 (https://github.com/elastic/apm-server/issues/3873)
# Ideally, we'd reference the ecs field "labels" and set the dynamic field to
# true to overwrite any settings that might be set at the data stream level.
- name: labels
type: object
description: |
A flat mapping of user-defined labels with string, boolean or number values.
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword. Example: `docker` and `k8s` labels.
- external: ecs
name: observer.hostname
- external: ecs
Expand Down
5 changes: 5 additions & 0 deletions apmpackage/apm/data_stream/app_metrics/fields/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,8 @@
The total virtual memory the process has.
metric_type: gauge
unit: byte
- name: numeric_labels
type: object
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as scaled_float.
5 changes: 5 additions & 0 deletions apmpackage/apm/data_stream/app_metrics/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ elasticsearch:
- histogram:
mapping:
type: histogram
- numeric_labels:
path_match: numeric_labels.*
mapping:
type: scaled_float
scaling_factor: 1000000
7 changes: 4 additions & 3 deletions apmpackage/apm/data_stream/error_logs/fields/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@
name: http.response.status_code
- external: ecs
name: http.version
# TODO: change labels to be ECS compliant in 8.0 (https://github.com/elastic/apm-server/issues/3873)
# Ideally, we'd reference the ecs field "labels" and set the dynamic field to
# true to overwrite any settings that might be set at the data stream level.
- name: labels
type: object
description: |
A flat mapping of user-defined labels with string, boolean or number values.
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword. Example: `docker` and `k8s` labels.
- external: ecs
name: message
- external: ecs
Expand Down
5 changes: 5 additions & 0 deletions apmpackage/apm/data_stream/error_logs/fields/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,8 @@
type: keyword
description: |
Keyword of specific relevance in the service's domain (eg. 'request', 'backgroundjob', etc)
- name: numeric_labels
type: object
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as scaled_float.
6 changes: 6 additions & 0 deletions apmpackage/apm/data_stream/error_logs/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ elasticsearch:
# ad-hoc searches on HTTP request headers without incurring storage cost
# for users who do not need this capability.
dynamic: false
dynamic_templates:
- numeric_labels:
path_match: numeric_labels.*
mapping:
type: scaled_float
scaling_factor: 1000000
7 changes: 4 additions & 3 deletions apmpackage/apm/data_stream/internal_metrics/fields/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@
name: host.name
- external: ecs
name: host.os.platform
# TODO: change labels to be ECS compliant in 8.0 (https://github.com/elastic/apm-server/issues/3873)
# Ideally, we'd reference the ecs field "labels" and set the dynamic field to
# true to overwrite any settings that might be set at the data stream level.
- name: labels
type: object
description: |
A flat mapping of user-defined labels with string, boolean or number values.
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword. Example: `docker` and `k8s` labels.
- external: ecs
name: observer.hostname
- external: ecs
Expand Down
5 changes: 5 additions & 0 deletions apmpackage/apm/data_stream/internal_metrics/fields/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,8 @@
type: keyword
description: |
Keyword of specific relevance in the service's domain (eg. 'request', 'backgroundjob', etc)
- name: numeric_labels
type: object
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as scaled_float.
7 changes: 4 additions & 3 deletions apmpackage/apm/data_stream/profile_metrics/fields/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@
name: host.name
- external: ecs
name: host.os.platform
# TODO: change labels to be ECS compliant in 8.0 (https://github.com/elastic/apm-server/issues/3873)
# Ideally, we'd reference the ecs field "labels" and set the dynamic field to
# true to overwrite any settings that might be set at the data stream level.
- name: labels
type: object
description: |
A flat mapping of user-defined labels with string, boolean or number values.
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword. Example: `docker` and `k8s` labels.
- external: ecs
name: observer.hostname
- external: ecs
Expand Down
5 changes: 5 additions & 0 deletions apmpackage/apm/data_stream/profile_metrics/fields/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,8 @@
type: keyword
description: |
Version of the runtime used.
- name: numeric_labels
type: object
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as scaled_float.
6 changes: 6 additions & 0 deletions apmpackage/apm/data_stream/profile_metrics/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ elasticsearch:
# Profile metrics currently must be dynamically
# mapped, as pprof metric names may be customised.
dynamic: true
dynamic_templates:
- numeric_labels:
path_match: numeric_labels.*
mapping:
type: scaled_float
scaling_factor: 1000000
7 changes: 4 additions & 3 deletions apmpackage/apm/data_stream/rum_traces/fields/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@
name: http.response.status_code
- external: ecs
name: http.version
# TODO: change labels to be ECS compliant in 8.0 (https://github.com/elastic/apm-server/issues/3873)
# Ideally, we'd reference the ecs field "labels" and set the dynamic field to
# true to overwrite any settings that might be set at the data stream level.
- name: labels
type: object
description: |
A flat mapping of user-defined labels with string, boolean or number values.
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword. Example: `docker` and `k8s` labels.
- external: ecs
name: observer.hostname
- external: ecs
Expand Down
5 changes: 5 additions & 0 deletions apmpackage/apm/data_stream/rum_traces/fields/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,3 +420,8 @@
type: keyword
description: |
Keyword of specific relevance in the service's domain (eg. 'request', 'backgroundjob', etc)
- name: numeric_labels
type: object
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as scaled_float.
6 changes: 6 additions & 0 deletions apmpackage/apm/data_stream/rum_traces/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ elasticsearch:
# ad-hoc searches on HTTP request headers without incurring storage cost
# for users who do not need this capability.
dynamic: false
dynamic_templates:
- numeric_labels:
path_match: numeric_labels.*
mapping:
type: scaled_float
scaling_factor: 1000000
7 changes: 4 additions & 3 deletions apmpackage/apm/data_stream/traces/fields/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@
name: http.response.status_code
- external: ecs
name: http.version
# TODO: change labels to be ECS compliant in 8.0 (https://github.com/elastic/apm-server/issues/3873)
# Ideally, we'd reference the ecs field "labels" and set the dynamic field to
# true to overwrite any settings that might be set at the data stream level.
- name: labels
type: object
description: |
A flat mapping of user-defined labels with string, boolean or number values.
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword. Example: `docker` and `k8s` labels.
- external: ecs
name: observer.hostname
- external: ecs
Expand Down
5 changes: 5 additions & 0 deletions apmpackage/apm/data_stream/traces/fields/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,3 +420,8 @@
type: keyword
description: |
Keyword of specific relevance in the service's domain (eg. 'request', 'backgroundjob', etc)
- name: numeric_labels
type: object
dynamic: true
description: |
Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as scaled_float.
6 changes: 6 additions & 0 deletions apmpackage/apm/data_stream/traces/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ elasticsearch:
# ad-hoc searches on HTTP request headers without incurring storage cost
# for users who do not need this capability.
dynamic: false
dynamic_templates:
- numeric_labels:
path_match: numeric_labels.*
mapping:
type: scaled_float
scaling_factor: 1000000
12 changes: 8 additions & 4 deletions apmpackage/apm/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,14 @@ Traces are written to `traces-apm-*` data streams, except for RUM traces, which
| kubernetes.node.name | Kubernetes node name | keyword |
| kubernetes.pod.name | Kubernetes pod name | keyword |
| kubernetes.pod.uid | Kubernetes Pod UID | keyword |
| labels | A flat mapping of user-defined labels with string, boolean or number values. | object |
| labels | Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword. Example: `docker` and `k8s` labels. | object |
| network.carrier.icc | ISO country code, eg. US | keyword |
| network.carrier.mcc | Mobile country code | keyword |
| network.carrier.mnc | Mobile network code | keyword |
| network.carrier.name | Carrier name, eg. Vodafone, T-Mobile, etc. | keyword |
| network.connection.subtype | Detailed network connection sub-type, e.g. "LTE", "CDMA" | keyword |
| network.connection.type | Network connection type, eg. "wifi", "cell" | keyword |
| numeric_labels | Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as scaled_float. | object |
| observer.ephemeral_id | Ephemeral identifier of the APM Server. | keyword |
| observer.hostname | Hostname of the observer. | keyword |
| observer.id | Unique identifier of the APM Server. | keyword |
Expand Down Expand Up @@ -265,9 +266,10 @@ Application metrics are written to service-specific `metrics-apm.app.*-*` data s
| kubernetes.node.name | Kubernetes node name | keyword | | |
| kubernetes.pod.name | Kubernetes pod name | keyword | | |
| kubernetes.pod.uid | Kubernetes Pod UID | keyword | | |
| labels | A flat mapping of user-defined labels with string, boolean or number values. | object | | |
| labels | Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword. Example: `docker` and `k8s` labels. | object | | |
| metricset.name | Name of the set of metrics. | keyword | | |
| network.connection.type | Network connection type, eg. "wifi", "cell" | keyword | | |
| numeric_labels | Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as scaled_float. | object | | |
| observer.ephemeral_id | Ephemeral identifier of the APM Server. | keyword | | |
| observer.hostname | Hostname of the observer. | keyword | | |
| observer.id | Unique identifier of the APM Server. | keyword | | |
Expand Down Expand Up @@ -380,9 +382,10 @@ Internal metrics are written to `metrics-apm.internal-*` data streams.
| kubernetes.node.name | Kubernetes node name | keyword | |
| kubernetes.pod.name | Kubernetes pod name | keyword | |
| kubernetes.pod.uid | Kubernetes Pod UID | keyword | |
| labels | A flat mapping of user-defined labels with string, boolean or number values. | object | |
| labels | Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword. Example: `docker` and `k8s` labels. | object | |
| metricset.name | Name of the set of metrics. | keyword | |
| network.connection.type | Network connection type, eg. "wifi", "cell" | keyword | |
| numeric_labels | Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as scaled_float. | object | |
| observer.ephemeral_id | Ephemeral identifier of the APM Server. | keyword | |
| observer.hostname | Hostname of the observer. | keyword | |
| observer.id | Unique identifier of the APM Server. | keyword | |
Expand Down Expand Up @@ -513,14 +516,15 @@ Application errors are written to `logs-apm.error.*` data stream.
| kubernetes.node.name | Kubernetes node name | keyword |
| kubernetes.pod.name | Kubernetes pod name | keyword |
| kubernetes.pod.uid | Kubernetes Pod UID | keyword |
| labels | A flat mapping of user-defined labels with string, boolean or number values. | object |
| labels | Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword. Example: `docker` and `k8s` labels. | object |
| message | For log events the message field contains the log message, optimized for viewing in a log viewer. For structured logs without an original message field, other fields can be concatenated to form a human-readable summary of the event. If multiple messages exist, they can be combined into one message. | match_only_text |
| network.carrier.icc | ISO country code, eg. US | keyword |
| network.carrier.mcc | Mobile country code | keyword |
| network.carrier.mnc | Mobile network code | keyword |
| network.carrier.name | Carrier name, eg. Vodafone, T-Mobile, etc. | keyword |
| network.connection.subtype | Detailed network connection sub-type, e.g. "LTE", "CDMA" | keyword |
| network.connection.type | Network connection type, eg. "wifi", "cell" | keyword |
| numeric_labels | Custom key/value pairs. Can be used to add meta information to events. Should not contain nested objects. All values are stored as scaled_float. | object |
| observer.ephemeral_id | Ephemeral identifier of the APM Server. | keyword |
| observer.hostname | Hostname of the observer. | keyword |
| observer.id | Unique identifier of the APM Server. | keyword |
Expand Down
2 changes: 1 addition & 1 deletion beater/beater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func newTestBeater(
if event.Labels == nil {
event.Labels = common.MapStr{}
}
event.Labels["wrapped_reporter"] = true
event.Labels["wrapped_reporter"] = "true"
}
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,14 @@
}
},
"labels": {
"ab_testing": true,
"ab_testing": "true",
"group": "experimental",
"organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8",
"segment": 5
"organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8"
},
"message": "Request method 'POST' not supported",
"numeric_labels": {
"segment": 5
},
"observer": {
"ephemeral_id": "00000000-0000-0000-0000-000000000000",
"id": "fbba762a-14dd-412c-b7e9-b79f903eb492",
Expand Down Expand Up @@ -343,8 +345,10 @@
}
},
"labels": {
"ab_testing": true,
"group": "experimental",
"ab_testing": "true",
"group": "experimental"
},
"numeric_labels": {
"segment": 5
},
"observer": {
Expand Down Expand Up @@ -540,11 +544,13 @@
}
},
"labels": {
"ab_testing": true,
"ab_testing": "true",
"group": "experimental",
"organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8",
"segment": 5,
"wrapped_reporter": true
"wrapped_reporter": "true"
},
"numeric_labels": {
"segment": 5
},
"observer": {
"ephemeral_id": "00000000-0000-0000-0000-000000000000",
Expand Down Expand Up @@ -677,13 +683,15 @@
}
},
"labels": {
"ab_testing": true,
"code": 200,
"ab_testing": "true",
"group": "experimental",
"segment": 5,
"success": true
"success": "true"
},
"metricset.name": "span_breakdown",
"numeric_labels": {
"code": 200,
"segment": 5
},
"observer": {
"ephemeral_id": "00000000-0000-0000-0000-000000000000",
"id": "fbba762a-14dd-412c-b7e9-b79f903eb492",
Expand Down
Loading