Skip to content

Azure monitor (backend) rejects logs without body #41947

Open
@lmolkova

Description

@lmolkova

Try some basic otel event stuff like

from azure.monitor.opentelemetry import configure_azure_monitor
from opentelemetry._events import get_event_logger, Event

configure_azure_monitor()
event_logger = get_event_logger(__name__)

event_logger.emit(Event(
    name="example_event",
    attributes={"key": "value"}
))

it won't export this log, but I can see a couple of different errors (either one or another, not both at the same time):

Image Image

So the backend rejected the message. Which is wrong - OTel events don't require a body. But if it's hard/impossible to change, then the exporter should set some default body.

This is a workaround

event_logger.emit(Event(
    name="example_event",
    attributes={"key": "value"},
    body="dummy body to avoid Azure Monitor dropping the event without a message",
))

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.Monitor - ExporterMonitor OpenTelemetry ExporterOpenTelemetryOpenTelemetry instrumentation (not Monitor-specific)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions