- Observability: other versions:
- Get started
- What is Elastic Observability?
- What’s new in 8.17
- Quickstart: Monitor hosts with Elastic Agent
- Quickstart: Monitor your Kubernetes cluster with Elastic Agent
- Quickstart: Monitor hosts with OpenTelemetry
- Quickstart: Unified Kubernetes Observability with Elastic Distributions of OpenTelemetry (EDOT)
- Quickstart: Collect data with AWS Firehose
- Add data from Splunk
- Applications and services
- Application performance monitoring (APM)
- Get started
- Learn about data types
- Collect application data
- View and analyze data
- Act on data
- Use APM securely
- Manage storage
- Configure APM Server
- Monitor APM Server
- APM APIs
- Troubleshooting
- Upgrade
- Release notes
- Known issues
- Synthetic monitoring
- Get started
- Scripting browser monitors
- Configure lightweight monitors
- Manage monitors
- Work with params and secrets
- Analyze monitor data
- Monitor resources on private networks
- Use the CLI
- Configure projects
- Multi-factor Authentication
- Configure Synthetics settings
- Grant users access to secured resources
- Manage data retention
- Use Synthetics with traffic filters
- Migrate from the Elastic Synthetics integration
- Scale and architect a deployment
- Synthetics support matrix
- Synthetics Encryption and Security
- Troubleshooting
- Real user monitoring
- Uptime monitoring (deprecated)
- Tutorial: Monitor a Java application
- Application performance monitoring (APM)
- CI/CD
- Cloud
- Infrastructure and hosts
- Logs
- Troubleshooting
- Incident management
- Data set quality
- Observability AI Assistant
- Reference
Metadata
editMetadata
editMetadata can enrich your events and make application performance monitoring even more useful. Let’s explore the different types of metadata that Elastic APM offers.
Labels
editLabels add indexed information to transactions, spans, and errors. Indexed means the data is searchable and aggregatable in Elasticsearch. Add additional key-value pairs to define multiple labels.
- Indexed: Yes
- Elasticsearch type: object
-
Elasticsearch field:
labels
- Applies to: Transactions | Spans | Errors
Label values can be a string, boolean, or number, although some agents only support string values at this time.
Because labels for a given key, regardless of agent used, are stored in the same place in Elasticsearch,
all label values of a given key must have the same data type.
Multiple data types per key will throw an exception, for example: {foo: bar}
and {foo: 42}
is not allowed.
Avoid defining too many user-specified labels. Defining too many unique fields in an index is a condition that can lead to a mapping explosion.
Agent API reference
edit-
Go:
SetLabel
-
Java:
setLabel
-
.NET:
SetLabel
-
Node.js:
setLabel
|addLabels
-
PHP:
Transaction
setLabel
|Span
setLabel
-
Python:
elasticapm.label()
-
Ruby:
set_label
-
Rum:
addLabels
Custom context
editCustom context adds non-indexed, custom contextual information to transactions and errors. Non-indexed means the data is not searchable or aggregatable in Elasticsearch, and you cannot build dashboards on top of the data. This also means you don’t have to worry about mapping explosions, as these fields are not added to the mapping.
Non-indexed information is useful for providing contextual information to help you quickly debug performance issues or errors.
- Indexed: No
- Elasticsearch type: object
-
Elasticsearch fields:
transaction.custom
|error.custom
- Applies to: Transactions | Errors
Setting a circular object, a large object, or a non JSON serializable object can lead to errors.
Agent API reference
edit-
Go:
SetCustom
- iOS: coming soon
-
Java:
addCustomContext
- .NET: coming soon
-
Node.js:
setCustomContext
- PHP: coming soon
-
Python:
set_custom_context
-
Ruby:
set_custom_context
-
Rum:
setCustomContext
User context
editUser context adds indexed user information to transactions and errors. Indexed means the data is searchable and aggregatable in Elasticsearch.
- Indexed: Yes
- Elasticsearch type: keyword
-
Elasticsearch fields:
user.email
|user.name
|user.id
- Applies to: Transactions | Errors
Agent API reference
edit-
Go:
SetUsername
|SetUserID
|SetUserEmail
- iOS: coming soon
-
Java:
setUser
- .NET coming soon
-
Node.js:
setUserContext
- PHP: coming soon
-
Python:
set_user_context
-
Ruby:
set_user
-
Rum:
setUserContext
On this page
ElasticON events are back!
Learn about the Elastic Search AI Platform from the experts at our live events.
Register now