elastic / apm

Elastic Application Performance Monitoring - resources and general issue tracking for Elastic APM.
https://www.elastic.co/apm
Apache License 2.0
374 stars 111 forks source link

Labels vs Intake for service-specific fields #763

Open basepi opened 1 year ago

basepi commented 1 year ago

Many services have information that is valuable to users when included in span/transaction documents. For example, we want to attach the S3 bucket and object keys to S3 spans. In PHP, users would like to have the Wordpress Theme attached to transactions.

For this discussion we're not talking about fields that will be used in the UI. Those should always be standardized in the intake spec. Instead, these are extra pieces of data that will be present in the documents should users need them, and can be used for custom dashboarding.

Labels

Pros:

Cons:

Intake

Pros:

Cons:

Other alternatives


Thoughts?

/cc @felixbarny @AlexanderWert @gregkalapos @estolfo

gregkalapos commented 1 year ago

We discussed this with @AlexanderWert and @felixbarny

In general:

One aspect we should also think about is OTel and OTel semantic conventions. Ideally, once we collect technology specific fields, we should try to use keys defined by OTel semantic conventions. For S3, it's not unrealistic to expect that it'd be covered by OTel.

Agents with OTel bridge already have otel.attributes - as said above, these end up in Labels in APM Server/Elasticsearch, but at least on the agent side it's distinct from labels.

So far, one suggestion we came up with is:

One open point is how these will end up in elasticsearch - especially de-dotting.

Current situation:

Options:

So in sum:

basepi commented 1 year ago

On the agent side, I think we should be aligned with OTel semantic conventions, it covers most technology specific fields and pack those into otel.attributes on the agent side. At the same time, try to contribute to OTel semantic conversions if specific fields are not yet defined there.

@gregkalapos Do we expect to block until the upstream contribution to the semantic conventions is accepted? Probably fine, just haven't been involved with the semantic conventions so I don't know how lengthy that process is.

gregkalapos commented 1 year ago

On the agent side, I think we should be aligned with OTel semantic conventions, it covers most technology specific fields and pack those into otel.attributes on the agent side. At the same time, try to contribute to OTel semantic conversions if specific fields are not yet defined there.

@gregkalapos Do we expect to block until the upstream contribution to the semantic conventions is accepted? Probably fine, just haven't been involved with the semantic conventions so I don't know how lengthy that process is.

Good question. For things, where there is not much room for discussion, I'd not block it - for S3 bucket, I don't think there is much discussion needed, so I'd not block that - but no strong feeling on that.

Also, a related idea: I don't know how much we want to document or communicate this, but if we already list these fields somewhere anyway (e.g. in this repo) we could add a column to track if something is already part of OTel semantic convention or not. That way we can communicate to users that things which are already part of the OTel spec will be as stable as the OTel spec, but others which are not yet in the OTel spec may change later (if e.g. our proposed key names are changed during OTel spec PR review).