Prompt Buddy logoPrompt Buddy

opentelemetry · OpenTelemetry Docs

Python Getting Started by Example

A step-by-step guide to instrumenting a Python Flask application using zero-code instrumentation to emit traces, metrics, and logs to the console.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Python Getting Started by Example

A step-by-step guide to instrumenting a Python Flask application using zero-code instrumentation to emit traces, metrics, and logs to the console.

When To Use

Use when you need to implement automatic telemetry collection for a Python web application using the OpenTelemetry agent.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/python-getting-started-by-workflow-guide.mdA guide providing a step-by-step walkthrough for instrumenting a Python application with OpenTelemetry using an HTTP server example.Questions about a guide providing a step-by-step walkthrough for instrumenting a Python application with OpenTelemetry using an HTTP...
examples/python-getting-started-by-opentelemetry-python-getting-started-pip-insta.shellShell commands to install the Flask framework and OpenTelemetry Python packages via pip.Exact payloads, commands, or snippets shown in Shell commands to install the Flask framework and OpenTelemetry Python packages via pip.
examples/python-getting-started-by-opentelemetry-python-flask-instrumentation.pythonA Python Flask application demonstrating basic OpenTelemetry instrumentation using a dice roll route.Exact payloads, commands, or snippets shown in A Python Flask application demonstrating basic OpenTelemetry instrumentation using a dice roll route.
examples/python-getting-started-by-opentelemetry-python-flask-run.shA shell command to run a Flask application on port 8080 as part of the OpenTelemetry Python getting started guide.Exact payloads, commands, or snippets shown in A shell command to run a Flask application on port 8080 as part of the OpenTelemetry Python getting started guide.
examples/python-getting-started-by-opentelemetry-python-getting-started-pip-insta-2.shellShell commands to install the OpenTelemetry Python distro using pip.Exact payloads, commands, or snippets shown in Shell commands to install the OpenTelemetry Python distro using pip.
examples/python-getting-started-by-opentelemetry-python-bootstrap-install-command.shellA shell command used to install OpenTelemetry Python instrumentation via the opentelemetry-bootstrap utility.Exact payloads, commands, or snippets shown in A shell command used to install OpenTelemetry Python instrumentation via the opentelemetry-bootstrap utility.
examples/python-getting-started-by-opentelemetry-python-span.jsonA JSON object representing a sample span with trace context, attributes, and timing metadata for OpenTelemetry Python instrumentation.Exact payloads, commands, or snippets shown in A JSON object representing a sample span with trace context, attributes, and timing metadata for OpenTelemetry Python...
examples/python-getting-started-by-opentelemetry-python-resourcemetrics.jsonA JSON representation of OpenTelemetry Python resource metrics including service attributes and telemetry SDK versions.Exact payloads, commands, or snippets shown in A JSON representation of OpenTelemetry Python resource metrics including service attributes and telemetry SDK versions.
examples/python-getting-started-by-opentelemetry-python-flask-tracer.pythonA Python script using Flask and OpenTelemetry to demonstrate manual span creation within a web route.Exact payloads, commands, or snippets shown in A Python script using Flask and OpenTelemetry to demonstrate manual span creation within a web route.
examples/python-getting-started-by-opentelemetry-python-span-attributes.jsonA JSON object representing a span with trace context, attributes, and timing information for OpenTelemetry Python instrumentation.Exact payloads, commands, or snippets shown in A JSON object representing a span with trace context, attributes, and timing information for OpenTelemetry Python ins...
examples/python-getting-started-by-opentelemetry-python-getting-started-dice-roll.pythonA Python implementation of a dice roller application demonstrating basic OpenTelemetry tracing and metrics instrumentation.Exact payloads, commands, or snippets shown in A Python implementation of a dice roller application demonstrating basic OpenTelemetry tracing and metrics instrument...
examples/python-getting-started-by-opentelemetry-python-resourcemetrics-2.jsonA JSON representation of OpenTelemetry Python resource metrics including SDK attributes and instrumentation scope data.Exact payloads, commands, or snippets shown in A JSON representation of OpenTelemetry Python resource metrics including SDK attributes and instrumentation scope data.
examples/python-getting-started-by-opentelemetry-collector-config.yamlA YAML configuration file for the OpenTelemetry Collector defining OTLP receivers and debug exporters for traces, metrics, and logs.Exact payloads, commands, or snippets shown in A YAML configuration file for the OpenTelemetry Collector defining OTLP receivers and debug exporters for traces, met...
examples/python-getting-started-by-opentelemetry-python-pip-install-otlp-exporter.shellShell command to install the OpenTelemetry OTLP exporter package using pip.Exact payloads, commands, or snippets shown in Shell command to install the OpenTelemetry OTLP exporter package using pip.
examples/python-getting-started-by-opentelemetry-python-getting-started-debug-exp.textA text log showing the debug exporter output for an OpenTelemetry Python resource span.Exact payloads, commands, or snippets shown in A text log showing the debug exporter output for an OpenTelemetry Python resource span.

What This Skill Covers

  • Get telemetry for your app in less than 5 minutes!
  • Main sections: Prerequisites, Example Application, Installation, Create and launch an HTTP Server, Instrumentation.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://opentelemetry.io/docs/languages/python/getting-started