elastic / elastic/apm-agent-nodejs

drop the redundant "hostname" and "env" labels added to metrics

Open
#2,794 0 comments 0 reactions 0 assignees View on GitHub
8.8-candidate agent-nodejs
Dominant language
JavaScript
Stars
594
Forks
244
Avg merge
1d 8h
Merged PRs (30d)
16

Description

The APM Node.js agent adds two labels to all exported metrics, e.g.:

```
"hostname": "pink.local",
"env": "development"
```

These end up in the Elasticsearch documents as `labels.hostname` and `labels.env`. These are redundant to the existing `host.hostname` and `service.environment` fields that are provided for all APM documents. Adding these labels is not in [the APM spec for metrics](https://github.com/elastic/apm/blob/main/specs/agents/metrics.md).

I think we should drop these labels. They are just wasted space in the DB.

For backward compat: It is possible there are users that are using these labels for queries and they would have to adjust. Does [this statement from the coming "breaking changes doc" PR for the APM specs](https://github.com/elastic/apm/pull/650/files#diff-6edaed3a2e10ae70d8abaf0ec1ba4652c925a7baeedd617498ebe4e6ad08aaf5R36) make this *not* a breaking change?

> In general, we don’t consider changes in the data we collect to be breaking, unless they have security or privacy implications.

I.e. we would be able to make this change without having to wait for a major release cycle?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.