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

WIP: Add datadog APM support #115

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

jmaupetit
Copy link
Contributor

Purpose

This is a follow up of #101 considering recent changes concerning BuildConfig and ImageStream. We've decided to add APM to our apps by adding new layers to base images (via service BuildConfig).

Proposal

  • add APM related variables to make them configurable (env_type, customers)
  • integrate APM for richie
  • integrate APM for edxapp

Closes #101

When Arnold clean a running stack labelled with a given
deployment_stamp, we also need to remove created BuildConfigs.
APM layer must be enabled or disabled given particular env_types or
customers. This can be achieved through the is_apm_enabled
configuration. BuildConfigs for apps should use this variable to
conditionally activate this feature during the build.
Enabling datadog APM can be summed as:

* installing datadog agent
* wrap the original command with the agent
* add configs (env vars) + secrets
@jmaupetit jmaupetit self-assigned this Sep 5, 2018
@jmaupetit jmaupetit added the WIP label Sep 5, 2018
@@ -29,7 +29,12 @@ spec:
source:
dockerfile: |-
FROM {{ richie_image_name }}:{{ richie_image_tag }}
# Add new statements here
USER 0
{% if is_apm_enabled -%}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment line because this Dockerfile extract will receive several separate augmentations?

# include this feature (default: "false")
is_apm_enabled: false
# APM agent port defaults to Datadog agent service port
apm_agent_port: 8126
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if we could omit the port when it is disabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the default (main) value. When it's disabled, you don't need to declare this variable at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my other message, you can add a default value on the BC template

Copy link
Contributor

@cchaudier cchaudier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I've juste somme comments.

@@ -29,7 +29,12 @@ spec:
source:
dockerfile: |-
FROM {{ richie_image_name }}:{{ richie_image_tag }}
# Add new statements here
USER 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why creating a BC who do nothing if we have no apm ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To take advantage of the cluster's docker repository and speed up image pulling. We only create a IS/BC for our public images that will:

  1. will be updated frequently
  2. requires further customization given a customer and an env_type

# Add new statements here
USER 0
{% if is_apm_enabled -%}
RUN pip install ddtrace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is only for datadog so why the variable is named is_apm_enabled ?
If we use an other APM we need a new name.
I propose is_apm_datadog_enabled, if we add newrelic whe can use is_apm_newrelic_enabled.

Or we can specify the APM name on the variable, so s_apm_enabled can ave the value (false, datadog, newrelic, etc.)

fieldRef:
fieldPath: status.hostIP
- name: DD_AGENT_SERVICE_PORT
value: "{{ apm_agent_port }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a default value ?

# include this feature (default: "false")
is_apm_enabled: false
# APM agent port defaults to Datadog agent service port
apm_agent_port: 8126
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my other message, you can add a default value on the BC template

@jmaupetit
Copy link
Contributor Author

@cchaudier is_apm_enabled is a feature flag that is proposed by Arnold, allowing you to enable/disable APM for your app services, if and only if you have implemented such feature in your application's templates.

Hence, Arnold does not have to be aware of the APM tool you choose. It's the app developer responsibility to implement such feature with datadog or any other tool/service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants