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

[APM] remove processor.event field requirement for data streams #161718

Closed
axw opened this issue Jul 12, 2023 · 8 comments
Closed

[APM] remove processor.event field requirement for data streams #161718

axw opened this issue Jul 12, 2023 · 8 comments
Labels
Team:APM All issues that need APM UI Team support

Comments

@axw
Copy link
Member

axw commented Jul 12, 2023

Describe the feature:

I would like to remove processor.event as a requirement for logs, metrics, and errors; ideally also for transactions and spans, if possible.

Instead of requiring processor.event, the UI can use a boolean should filter with minimum_should_match to query for documents that either have processor.event (for old pre-8.0 documents/indices) or that have relevant data_stream.* fields.

Describe a specific use case for the feature:

  1. Simplify the data model & mappings, removing historical cruft
  2. Reduce unnecessary storage overhead
  3. Enable application metrics/logs to be written to non-APM specific data streams, and still show up in APM UI

(3) essentially means querying metrics like system/container/process CPU usage either from metrics-* without a filter on processor.event: metric, or from apm-* with a filter.

More details:

In 6.x and 7.x, APM documents were written to indices whose names users could control. We set processor.event fields in the documents to distinguish the event type -- transaction, span, error, metric, and log.

Since 8.0, APM documents have been written to data streams: traces-apm*, logs-apm*, and metrics-apm*. Users cannot change the prefix, they can only change the namespace. Specifically, events are routed as follows:

  • transactions and spans go into traces-apm-<namespace> or traces-apm.rum-<namespace>
  • errors go into traces-apm.error-<namespace>
  • metrics go into metrics-apm*-<namespace> (there are numerous metric data streams)
  • (application) logs go into logs-apm.app.<service>-<namespace>

The processor.event fields is thus mostly redundant. It is possible to infer the event type from the data_stream.* fields:

  • data_stream.type: traces implies it's either a transaction or a span
  • data_stream.type: metrics implies it's a metric
  • (data_stream.type: logs) and (data_stream.dataset: apm.error) implies it's an error
  • for all other data_stream.type: logs it's a log
@axw axw added the Team:APM All issues that need APM UI Team support label Jul 12, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:APM)

@dgieselaar
Copy link
Member

@axw I'm not sure how easy this all is with e.g. custom dashboards?

@axw
Copy link
Member Author

axw commented Jul 12, 2023

@dgieselaar which part is hard? Could you do a filter on (processor.event: metric) or (data_stream.type: metrics) for example?

I suppose it would be a mildly breaking change though.

@dgieselaar
Copy link
Member

@axw:

@dgieselaar which part is hard? Could you do a filter on (processor.event: metric) or (data_stream.type: metrics) for example?

Yes, but this happens in so many places that it's probably not worth it to spend the time making this change, or the complexity from maintaining backwards compatibility. But we do have a carrot that we can offer: we don't use processor.name anywhere in the UI.

@axw
Copy link
Member Author

axw commented Jul 18, 2023

So will we never remove processor.event? Otherwise, what would it take?

One of the main motivations behind this is to enable sending system, runtime, and application metrics to metrics-generic-default. Not necessarily that exact data stream name, but something created by the generic metrics data stream index template built into Elasticsearch.

@dgieselaar
Copy link
Member

@axw I don't think the answer is never, it's just a pretty huge effort on our side for something of which the value is unclear to us. Maybe a pitch is a better venue?

@axw
Copy link
Member Author

axw commented Jul 19, 2023

Fair enough! I did hesitate, but didn't realise it would be such a big effort. I'll reopen as a pitch.

@axw axw closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2023
axw added a commit to axw/apm-server that referenced this issue Aug 21, 2023
This field is not used by the UI, and is redundant;
its value can be inferred from data_stream.dataset`.

See elastic/kibana#161718 (comment)
axw added a commit to axw/apm-server that referenced this issue Aug 21, 2023
This field is not used by the UI, and is redundant;
its value can be inferred from data_stream.dataset`.

See elastic/kibana#161718 (comment)
axw added a commit to axw/apm-server that referenced this issue Aug 21, 2023
This field is not used by the UI, and is redundant;
its value can be inferred from data_stream.dataset`.

See elastic/kibana#161718 (comment)
axw added a commit to axw/apm-server that referenced this issue Aug 21, 2023
This field is not used by the UI, and is redundant;
its value can be inferred from data_stream.dataset`.

See elastic/kibana#161718 (comment)
axw added a commit to axw/apm-server that referenced this issue Aug 21, 2023
This field is not used by the UI, and is redundant;
its value can be inferred from data_stream.dataset`.

See elastic/kibana#161718 (comment)
axw added a commit to elastic/apm-server that referenced this issue Aug 21, 2023
This field is not used by the UI, and is redundant;
its value can be inferred from data_stream.dataset`.

See elastic/kibana#161718 (comment)
axw added a commit to axw/apm-tools that referenced this issue Aug 28, 2023
Stop sorting on the `processor.event` field,
so we can stop emitting it for logs. This is
similar to the inference done at
https://github.com/elastic/apm-data/blob/455fb9f1280fa9dcb0ff4fa9ee08adb9a7970511/model/modelpb/apmevent.pb.type.go

See also elastic/kibana#161718
axw added a commit to elastic/apm-tools that referenced this issue Aug 28, 2023
* approvaltest: infer processor.event

Stop sorting on the `processor.event` field,
so we can stop emitting it for logs. This is
similar to the inference done at
https://github.com/elastic/apm-data/blob/455fb9f1280fa9dcb0ff4fa9ee08adb9a7970511/model/modelpb/apmevent.pb.type.go

See also elastic/kibana#161718
bmorelli25 pushed a commit to bmorelli25/apm-server that referenced this issue Sep 5, 2023
This field is not used by the UI, and is redundant;
its value can be inferred from data_stream.dataset`.

See elastic/kibana#161718 (comment)
@axw
Copy link
Member Author

axw commented Oct 9, 2023

(Not going to open as a pitch, there should be a new project process soon.)

bmorelli25 pushed a commit to bmorelli25/observability-docs that referenced this issue Dec 18, 2023
This field is not used by the UI, and is redundant;
its value can be inferred from data_stream.dataset`.

See elastic/kibana#161718 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:APM All issues that need APM UI Team support
Projects
None yet
Development

No branches or pull requests

3 participants