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

Azure Failures #34616

Open
mike-england opened this issue Mar 5, 2024 · 5 comments
Open

Azure Failures #34616

mike-england opened this issue Mar 5, 2024 · 5 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor - Exporter Monitor OpenTelemetry Exporter needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@mike-england
Copy link

  • Package Name: azure-monitor-opentelemetry
  • Package Version: 1.3.0
  • Operating System: Debian (bookworm)
  • Python Version: 3.10

Describe the bug
I'm worried I'm opening up an old 'bug': #33741 but I'm still having problems with Failures being reported to Azure Application Insights. The opentelemtry-python-contrib project has updated to include support for Flask 3 (version 1.23.0/0.44b0) and I can confirm that it's working as expected. However, when I include OTEL_PYTHON_EXCLUDED_URLS to keep one of my endpoints from reporting, they're still showing up as a request and a failed one

To Reproduce
Steps to reproduce the behavior:
I'm going to include some sample code in a docker file that you can try:

app.py:

from azure.monitor.opentelemetry import configure_azure_monitor

configure_azure_monitor()

import flask

app = flask.Flask(__name__)

@app.route("/")
def test():
    print('got one')
    return "Test flask request"

@app.route("/health")
def health():
    print('health endpoint')
    return "Health request"

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8080)

Dockerfile:

FROM python:3.10-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

COPY requirements.txt .
RUN python -m pip install -r requirements.txt

WORKDIR /app
COPY . /app

RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser

CMD ["python", "app.py"]

requirements.txt:

Flask==3.0.0
azure-monitor-opentelemetry==1.3.0

And to run it:

docker build -t azuretelemetry . && docker run --rm -p 8080:8080 -e APPLICATIONINSIGHTS_CONNECTION_STRING=$APPLICATIONINSIGHTS_CONNECTION_STRING -e OTEL_EXPERIMENTAL_RESOURCE_DETECTORS=$OTEL_EXPERIMENTAL_RESOURCE_DETECTORS -e OTEL_PYTHON_EXCLUDED_URLS=$OTEL_PYTHON_EXCLUDED_URLS azuretelemetry

Where OTEL_PYTHON_EXCLUDED_URLS="health,swagger.*"

Expected behavior
Endpoint requests are ignored

Screenshots
Screenshot 2024-03-04 at 4 01 37 PM

Any suggestions? Is this a different project that would need to take care of this? Am I doing something wrong?

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor - Exporter Monitor OpenTelemetry Exporter needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 5, 2024
@kashifkhan
Copy link
Member

Thank you for the feedback @mike-england . We will investigate and get back to you asap.

@kashifkhan kashifkhan removed the needs-team-triage Workflow: This issue needs the team to triage. label Mar 5, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Mar 5, 2024
@jeremydvoss
Copy link
Member

I'll be looking into this.

@lzchen lzchen assigned jeremydvoss and unassigned lzchen Mar 6, 2024
@jeremydvoss
Copy link
Member

I've confirmed that the OTEL_PYTHON_EXCLUDED_URLS works as intended with full URLs, URL endings, and even wildcards. This is a question for the Flask instrumentation itself. So, I recommend creating an issue in the OTel contrib repo instead. But, let's see if we can solve it here. can you provide the full urls of the telemetry that you want to be filtered? could you also confirm that the environment variable is successfully being set in docker and visible from the app?

@mike-england
Copy link
Author

mike-england commented Mar 7, 2024 via email

@lmazuel lmazuel added the Service Attention Workflow: This issue is responsible by Azure service team. label May 8, 2024
Copy link

github-actions bot commented May 8, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jeremydvoss @lzchen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor - Exporter Monitor OpenTelemetry Exporter needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants