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

Exceptions are reported twice in Application Insights using Azure Functions #37919

Open
viktor-morin opened this issue Oct 16, 2024 · 1 comment
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. Event Hubs 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

Comments

@viktor-morin
Copy link

  • azure-monitor-opentelemetry:
  • 1.6.1:
  • Linux:
  • 3.11:

Describe the bug
Running an Azure Function, which listen to an eventhub (not sure if it's relevant), causing exception to be logged twice.

To Reproduce
function_app.py

import azure.functions as func
import json
import os
from typing import Iterable
from azure.monitor.opentelemetry import configure_azure_monitor

counter = 0
app = func.FunctionApp()

@app.blob_input(
    arg_name="eventconfig",
    connection="AzureWebJobsStorage",
    path="config/event_config.json",
    data_type=func.DataType.BINARY,
)
@app.event_hub_message_trigger(
    arg_name="events",
    data_type=func.DataType.BINARY,
    event_hub_name="EVENT_HUB_NAME",
    connection="EVENT_HUB_CONNECTION_STRING",
    consumer_group=os.environ["EVENT_HUB_CONSUMER_GROUP"],
    cardinality=func.Cardinality.MANY,
)
def eventhub_trigger(events: Iterable[func.EventHubEvent], eventconfig: bytes):
    configure_azure_monitor()
    global counter
    counter = counter + 1
    raise Exception(f"Counter: {counter}")

requirements.txt

azure-functions
azure-data-tables==12.*
azure-identity==1.*
azure-keyvault-secrets==4.*
tzdata

local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "APPLICATIONINSIGHTS_CONNECTION_STRING": "InstrumentationKey=xxxxx"
  }
}

Expected behavior
We expect the exception to only be logged once in Application Insights

Screenshots
Same exception is shown twice
Image

Additional context
NA

@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. Event Hubs 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 labels Oct 16, 2024
Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

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. Event Hubs 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
Projects
None yet
Development

No branches or pull requests

2 participants