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

Add service environment configuration to elastic exporter #438

Closed
vinsce opened this issue Jul 14, 2020 · 8 comments · Fixed by #1022
Closed

Add service environment configuration to elastic exporter #438

vinsce opened this issue Jul 14, 2020 · 8 comments · Fixed by #1022
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@vinsce
Copy link

vinsce commented Jul 14, 2020

Based on the Kibana documentation, the special field service.environment is used to identify the environment of the service. If the variable is not specified, the environment associated with the service is Not defined.

image

However the service.environment variable is not recognized by the elastic exporter, and it is considered a generic label and converted to labels.service_environment:
image

This is the collector configuration I'm using:

receivers:
  otlp:
    endpoint: "localhost:55680"

processors:
    resource/service:
        labels: {
          "service.environment": "test",
          "service.name": "application name"
        }
    batch:
        timeout: 1s
        send_batch_size: 1024

exporters:
    elastic:
        apm_server_url: "http://localhost:8200"

service:
    pipelines:
        traces:
            receivers: [otlp]
            processors: [batch, resource/service]
            exporters: [elastic]

The service.name is correctly propagated to elastic as it is but the service.environment is not.

@vinsce vinsce changed the title Add environment configuration to elastic exporter Add service environment configuration to elastic exporter Jul 14, 2020
mxiamxia referenced this issue in mxiamxia/opentelemetry-collector-contrib Jul 22, 2020
@jrcamp
Copy link
Contributor

jrcamp commented Jul 30, 2020

@axw looks like you added the initial elastic implementation, can you take a look at this?

@jrcamp jrcamp added this to the Backlog milestone Jul 30, 2020
@axw
Copy link
Contributor

axw commented Jul 31, 2020

Thanks for the ping @jrcamp, will do.

@axw
Copy link
Contributor

axw commented Jul 31, 2020

We can certainly look for service.environment as requested, but I wonder if we should be using service.namespace instead. That would be nice in that it's a defined attribute, and an environment is a kind of namespace; but not all namespaces may be considered "environments".

@cyrille-leclerc thoughts?

@cyrille-leclerc
Copy link
Member

FYI, after discussing with @axw , we have created open-telemetry/opentelemetry-specification#752

@axw
Copy link
Contributor

axw commented Aug 24, 2020

open-telemetry/opentelemetry-specification#606 was recently merged, adding the deployment.environment attribute. We should translate from that to service.environment ECS/Elastic APM field, which has the same semantics.

@axw
Copy link
Contributor

axw commented Sep 2, 2020

Quick update: there's ongoing discussion about the new convention at open-telemetry/opentelemetry-specification#851. Once that is resolved, I'll update the Elastic exporter.

@cyrille-leclerc
Copy link
Member

@vinsce here is a sample to define the deployment.environment on your OpenTelemetry instrumentation and get it mapped to the service.environment in Elastic APM. It requires to use the version 0.11+ of the OpenTelemetry Collector:

export OTEL_RESOURCE_ATTRIBUTES=service.name=monitor,service.namespace=com-shoppingcart,service.version=1.0-SNAPSHOT,deployment.environment=staging

java -javaagent:$OPEN_TELEMETRY_AGENT_JAR \
     -Dotel.otlp.endpoint=localhost:55680 \
     -classpath target/classes/ FrontendMonitor

@vinsce
Copy link
Author

vinsce commented Oct 15, 2020

Tested with the OpenTelemetry Collector 0.11. Thank you
kibana_envs

@andrewhsu andrewhsu added the enhancement New feature or request label Jan 6, 2021
ljmsc referenced this issue in ljmsc/opentelemetry-collector-contrib Feb 21, 2022
* change the histogram aggregator to have a consistent but blocking Checkpoint()

* docs

* wrapping docs

* remove currentIdx from the 8bit alignment check

* stress test

* add export and move lockfreewrite algorithm to an external struct.

* move state locker to another package.

* add todos

* minimal tests

* renaming and docs

* change to context.Background()

* add link to algorithm and grammars

Co-authored-by: Joshua MacDonald <[email protected]>
bogdandrutu pushed a commit that referenced this issue May 12, 2022
* Revert version of syslog-go

* chlog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants