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

[FUP Optimisation] redis: added endpoint filtering #688

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

CagriYonca
Copy link
Contributor

@CagriYonca CagriYonca commented Jan 17, 2025

Added endpoint filtering for redis instrumentation. We've aligned with Java and NodeJS teams. The customer has three options to filter endpoints:

  • Defining ignore-endpoint through the configuration.yaml file of the agent
  • Using environment-variable before initialisation
  • Using src/instana/configurator.py

If the customer used more than one way of these three, we'd be using one according to this priority:

  • Environment variable > in-code setting > agent configuration

Ignoring endpoints through env variable

The customer can use filtering with the environment variable below. If the env variable is set, other two ways will be ignored.

  • INSTANA_IGNORE_ENDPOINTS="service:endpoint"
  • INSTANA_IGNORE_ENDPOINTS="service:endpoint1,endpoint2"
  • Filtering redis instrumentation at all:
    INSTANA_IGNORE_ENDPOINTS="service"
  • Filtering multiple instrumentations:
    INSTANA_IGNORE_ENDPOINTS="service1:endpoint1;service2:endpoint1"
    INSTANA_IGNORE_ENDPOINTS="service1;service2"

Ignoring endpoints through the configurator.py file

The customer can add a configuration line like below:

  • config["tracing"]["ignore_endpoints"] = {"service1": ["endpoint1", "endpoint2"], "service2": []}

Ignoring endpoints through the agent configuration

The customer can add a configuration to agent-folder/etc/instana/configuration.yaml

com.instana.tracing:
  ignore-endpoints:
    service1:    # Add package name, e.g., redis, dynamodb
      - 'endpoint1' # Add endpoint
      - 'endpoint2'
    service2:
      - 'endpoint1'

Reference: https://github.ibm.com/instana/technical-documentation/tree/master/tracing/specification#ignoring-endpoints

@CagriYonca CagriYonca self-assigned this Jan 17, 2025
@CagriYonca CagriYonca requested a review from a team as a code owner January 17, 2025 13:16
@CagriYonca CagriYonca added this to the H1-2025 milestone Jan 17, 2025
Copy link
Member

@pvital pvital left a comment

Choose a reason for hiding this comment

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

Few change requests.

@CagriYonca CagriYonca force-pushed the endpoint_filtering branch 4 times, most recently from 3383d8c to 43b13cd Compare January 28, 2025 13:06
@CagriYonca CagriYonca requested a review from pvital January 28, 2025 13:41
Copy link
Member

@pvital pvital left a comment

Choose a reason for hiding this comment

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

Well done, @CagriYonca, but I still have some comments.

Copy link
Member

@pvital pvital left a comment

Choose a reason for hiding this comment

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

Few more request changes.

As discussed in our call, let's change the approach and filter the spans before sending them to the Agent (or Collector) - see src/instana/agent/host.py:300. That way, we can have a one-size-fits-all solution, and no changes to the instrumentation code will be necessary.

@CagriYonca CagriYonca requested a review from pvital February 4, 2025 17:08
Copy link
Member

@pvital pvital left a comment

Choose a reason for hiding this comment

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

Few requests.

@CagriYonca CagriYonca requested a review from pvital February 5, 2025 12:08
Signed-off-by: Cagri Yonca <cagri@ibm.com>
Copy link
Member

@pvital pvital left a comment

Choose a reason for hiding this comment

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

It looks good to me.

@CagriYonca CagriYonca merged commit 7cae768 into main Feb 5, 2025
13 of 14 checks passed
@CagriYonca CagriYonca deleted the endpoint_filtering branch February 5, 2025 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants