Skip to main content

OpenStack SDK (openstacksdk) instrumentation for OpenTelemetry

Project description

OpenTelemetry OpenStack SDK Instrumentation

OpenStack SDK (openstacksdk) instrumentation for OpenTelemetry.

The OpenStack SDK reaches every service through an openstack.connection.Connection whose service proxies (conn.compute, conn.network, ...) subclass openstack.proxy.Proxy. Every REST call the SDK makes funnels through a single method, Proxy.request, no matter which resource method the application called.

This instrumentor wraps Proxy.request so each SDK REST call becomes a CLIENT span. On instrument() it:

  • records one span per request, named {service_type} {HTTP method} (for example compute GET), falling back to the bare HTTP method when the proxy has no service type;
  • sets the standard HTTP client attributes http.request.method, http.response.status_code, url.full, server.address and server.port (the fully resolved URL is read back from the response once keystoneauth has looked up the endpoint);
  • adds openstack.service_type and openstack.region_name describing the proxy that issued the call;
  • injects the active W3C trace context into the outgoing request headers, so a trace started in the SDK continues on the OpenStack service that handles the request (when that service is instrumented too).

Proxy.request defaults to raise_exc=False, so HTTP error statuses come back as ordinary responses rather than exceptions; the span status is set to ERROR for any status code >= 400, and transport-level failures are recorded as exceptions on the span.

Note: the span is created at the proxy layer, so keystoneauth's own token and version-discovery requests — which go straight through the session rather than a proxy — are not traced. Only genuine SDK service calls produce spans.

Usage

from opentelemetry.instrumentation.openstacksdk import (
    OpenStackSDKInstrumentor,
)

OpenStackSDKInstrumentor().instrument()

import openstack

conn = openstack.connect(cloud="mycloud")
list(conn.compute.servers())  # emits a "compute GET" client span

Pass a tracer_provider to instrument() to use a provider other than the global default.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file opentelemetry_instrumentation_openstacksdk-0.11.0.tar.gz.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openstacksdk-0.11.0.tar.gz
Algorithm Hash digest
SHA256 701e559100ad08d8ec4a3ae3cd272d341b06ad38a5017a221fd6f659a73cc55a
MD5 1467b29218f341e90f50ce29509f8498
BLAKE2b-256 7ecd58d2ca0ce3fd8257542220b4e4c1fd0af1931c81b954f8e124e802a8d28b

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentelemetry_instrumentation_openstacksdk-0.11.0.tar.gz:

Publisher: publish-pypi.yml on daipham3213/opentelemetry-openstack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opentelemetry_instrumentation_openstacksdk-0.11.0-py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openstacksdk-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e21b8cbbab797b80b92cf9940257300be9dee86d35762cfa5a89776d56deb99
MD5 83ee2940319d09e18aa7e1324a1f083b
BLAKE2b-256 90d6b334e6a2a3a2b217e8bdc0fc62b0f5bd603be6f1b4f96d3e655ca3f8523a

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentelemetry_instrumentation_openstacksdk-0.11.0-py3-none-any.whl:

Publisher: publish-pypi.yml on daipham3213/opentelemetry-openstack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page