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] Update agent configuration snippets to include service environment variable #77739

Closed
formgeist opened this issue Sep 17, 2020 · 5 comments · Fixed by #85855
Closed

[APM] Update agent configuration snippets to include service environment variable #77739

formgeist opened this issue Sep 17, 2020 · 5 comments · Fixed by #85855
Assignees
Labels
apm:Agent Configuration enhancement New value added to drive a business result low hanging fruit DO NOT USE. Use `good first issue` instead Team:APM All issues that need APM UI Team support v7.11.0

Comments

@formgeist
Copy link
Contributor

formgeist commented Sep 17, 2020

Summary

We want to include the service environment configuration in the default agent configuration snippets to make it clear that we're setting a default unless otherwise specified in an effort to do away with services with empty environment values. Environments are becoming a critical part of the product - we use it for anomaly detection and agent configuration, and we're seeing more and more issues with the environments added are not aligned or used, so data is mixed up when analyzing it using the APM app.

Solution

Update the getting started tutorial snippets for each agent to exemplify the environment variable and note that the agent is using a default value already, in case the user wishes to change it before data starts coming in.

Here's an example from the Python (Django) snippets revised;

Source:

# Add the agent to the installed apps
INSTALLED_APPS = (
  'elasticapm.contrib.django',
  # ...
)

ELASTIC_APM = {
  # Set required service name. Allowed characters:
  # a-z, A-Z, 0-9, -, _, and space
  'SERVICE_NAME': '',

  # Use if APM Server requires a token
  'SECRET_TOKEN': '',

  # Set custom APM Server URL (default: http://localhost:8200)
  'SERVER_URL': '',

  # Set service environment variable (default: production)
  'ENVIRONMENT': '',
}

# To send performance metrics, add our tracing middleware:
MIDDLEWARE = (
  'elasticapm.contrib.django.middleware.TracingMiddleware',
  #...
)
@formgeist formgeist added Team:APM All issues that need APM UI Team support enhancement New value added to drive a business result labels Sep 17, 2020
@elasticmachine
Copy link
Contributor

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

@bmorelli25
Copy link
Member

I can make this change if you'd like!

@formgeist
Copy link
Contributor Author

@bmorelli25 Did you want to pick this up? That'd be a great help and addition 👍

@bmorelli25
Copy link
Member

Yup, planning on getting it in today. Just saw that @smith moved it to 7.12 though?

@bmorelli25 bmorelli25 self-assigned this Dec 14, 2020
@smith
Copy link
Contributor

smith commented Dec 14, 2020

@bmorelli25 please feel free to move it back if you're on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:Agent Configuration enhancement New value added to drive a business result low hanging fruit DO NOT USE. Use `good first issue` instead Team:APM All issues that need APM UI Team support v7.11.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants