OpenTelemetry Python API and SDK

Overview

Getting Started   •   API Documentation   •   Getting In Touch (GitHub Discussions)

GitHub release (latest by date including pre-releases) Codecov Status license
Build Status Beta

Contributing   •   Examples


OpenTelemetry Python

This page describes the Python OpenTelemetry implementation. OpenTelemetry is an observability framework for cloud-native software.

Requirements

Unless otherwise noted, all published artifacts support Python 3.6 or higher. See CONTRIBUTING.md for additional instructions for building this project for development.

Getting started

The goal of OpenTelemetry is to provide a single set of APIs to capture distributed traces and metrics from your application and send them to an observability platform. This project lets you do just that for applications written in Python.

This repository includes multiple installable packages. The opentelemetry-api package includes abstract classes and no-op implementations that comprise the OpenTelemetry API following the OpenTelemetry specification. The opentelemetry-sdk package is the reference implementation of the API.

Libraries that produce telemetry data should only depend on opentelemetry-api, and defer the choice of the SDK to the application developer. Applications may depend on opentelemetry-sdk or another package that implements the API.

The API and SDK packages are available on the Python Package Index (PyPI). You can install them via pip with the following commands:

pip install opentelemetry-api
pip install opentelemetry-sdk

The exporter/ directory includes OpenTelemetry exporter packages. You can install the packages separately with the following command:

pip install opentelemetry-exporter-{exporter}

The propagator/ directory includes OpenTelemetry propagator packages. You can install the packages separately with the following command:

pip install opentelemetry-propagator-{propagator}

To install the development versions of these packages instead, clone or fork this repository and perform an editable install:

pip install -e ./opentelemetry-api
pip install -e ./opentelemetry-sdk
pip install -e ./instrumentation/opentelemetry-instrumentation-{instrumentation}

For additional exporter and instrumentation packages, see the opentelemetry-python-contrib repository.

Running Performance Tests

This section provides details on how to reproduce performance tests results on your own machine.

Resource Usage Tests

  1. Install scalene using the following command
pip install scalene
  1. Run the scalene tests on any of the example Python programs
scalene opentelemetry-<PACKAGE>/tests/performance/resource-usage/<PATH_TO_TEST>/profile_resource_usage_<NAME_OF_TEST>.py

Documentation

The online documentation is available at https://opentelemetry-python.readthedocs.io/. To access the latest version of the documentation, see https://opentelemetry-python.readthedocs.io/en/latest/.

Contributing

For information about contributing to OpenTelemetry Python, see CONTRIBUTING.md.

We meet weekly on Thursdays at 9AM PST. The meeting is subject to change depending on contributors' availability. Check the OpenTelemetry community calendar for specific dates and Zoom meeting links.

Meeting notes are available as a public Google doc. For edit access, get in touch on GitHub Discussions.

Approvers (@open-telemetry/python-approvers):

For more information about the approver role, see the community repository.

Maintainers (@open-telemetry/python-maintainers):

For more information about the maintainer role, see the community repository.

Thanks to all the people who already contributed!

Project Status

For project boards and milestones, see the following links:

We try to keep these links accurate, so they're the best place to go for questions about project status. The dates and features described in the issues and milestones are estimates and subject to change.

Comments
  • OpenCensusMetricsExporter: GKE resource labels not sent

    OpenCensusMetricsExporter: GKE resource labels not sent

    When running on GKE, the metrics exported with the OpenCensusMetricsExporter do not have any GKE resource labels (pod_name, container_name, node_name, etc...). Should those be added to the resource labels before shipping the metric with the exporters ?

    • @aabmass for awareness.
    • @AndrewAXue , I see you implemented an automatic resource detection, does #853 support GKE as well ?
    bug 
    opened by ocervell 34
  • Automated release workflow

    Automated release workflow

    Hey all!

    We've spent a lot of time lately improving our release workflow in the OTel Java repos, and I'd like to see if our toil and pain can be of any benefit to other repos (starting with python of course!).

    I also think there's some benefit of shared cross-SIG knowledge going forward if we follow somewhat similar workflow practices.

    I've tried to document things here: https://github.com/trask/repository-template/blob/main/template-docs/release-automation.md

    Some highlights in this PR:

    • Uses -dev version suffix on main (@lzchen mentioned you were thinking about doing this anyways)
    • The release workflow autogenerates the release notes from the change log and publishes the github release
    • Uses the bot workaround discussed in https://github.com/open-telemetry/community/issues/809#issuecomment-1015121722 (maybe we should consider creating a shared otel bot that all repos could use?)
    • The branch names are based on the minor release (e.g. release/v1.12.x-0.31bx), and patch releases are made out of those same branches. Tags are still applied to each individual release.

    New complications in this repo that we hadn't faced in the Java repos:

    • Separate versions for stable/unstable components (this wasn't a big deal, just a bit more workflow code to handle/increment them both).
    • I tried adding the Skip Changelog label to the generated pull requests that target main, but that requires giving the bot triage rights to the repo, so instead suppressed the changelog workflow when github.actor is the bot.

    I'd love to stop by your SIG meeting, but it's always at the same time as the Java SIG 😢. Maybe next week I can sneak away and jump to your meeting for a bit.

    Please throw your questions this way though, I'd love to better understand where we can align more, and where things will naturally diverge based on SIG needs/preferences.

    opened by trask 33
  • B3 propagation does not handle ParentSpanId

    B3 propagation does not handle ParentSpanId

    Currently the b3 propagator does not handle the ParentSpanId. this is a field that does not exist in w3c tracecontext:

    https://github.com/openzipkin/b3-propagation#parentspanid

    I believe to do this properly, we need to:

    1. generate a single string version of the headers and add it into tracestate under the "b3" key.
    2. inject the values by extracting them from the tracestate.

    Thoughts?

    bug sdk 
    opened by toumorokoshi 33
  • Ease migration of experimental to stable packages

    Ease migration of experimental to stable packages

    Cont'd discussion from 01/21/21 SIG

    Taken from https://github.com/open-telemetry/opentelemetry-python/blob/master/rationale.md Our current planned release versioning story is as follows:

    V1.0.0 Release (tracing, baggage, propagators, context) opentelemetry-api 1.0.0 Contains APIs for tracing, baggage, propagators, context opentelemetry-tracing 1.0.0 Contains the tracing SDK opentelemetry-sdk 1.0.0 Contains SDK components for tracing, baggage, propagators, and context Contains the following experimental packages opentelemetry-api-metrics 0.x.y Contains the EXPERIMENTAL API for metrics. There are no stability guarantees. opentelemetry-metrics 0.x.y Contains the EXPERIMENTAL SDK for metrics. There are no stability guarantees. V1.15.0 Release (with metrics) opentelemetry-api 1.15.0 Contains APIs for tracing, baggage, propagators, context, and metrics opentelemetry-tracing 1.15.0 Contains tracing SDK opentelemetry-metrics 1.15.0 Contains metrics SDK opentelemetry-sdk 1.15.0 Contains SDK components for tracing, baggage, propagators, context and metrics

    In terms of following the specs and having backwards compatibility when releasing, we are good. The only issue is when we move experimental packages from experimental to our stable api package, there is a point of contention for customers. With the current design, we expect users to use opentelemetry-api. They can install opentelemetry-tracing and use that to get tracing/baggage/propagator/context functionality or the can install opentelemetry-sdk which will simply just pull in opentelemetry-tracing. If users want to try want to try out experimental metrics signals, they can pull in both opentelemetry-api-metrics and opentelemetry-metrics. These packages will ONLY have experimental related signals.

    Now when we release v1.15.0, the experimental api signals will be moved into the stable opentelemetry-api package. Ideally there should be no changes to the namespace, so users should not have to modify any of their import paths to begin using metrics (if they were using the experimental package previously). The only thing that they have to do is to uninstall the experimental opentelemetry-api-metrics package to avoid conflicts.

    Now the question is. Would this step of "removing the opentelemetry-api-metrics package" be a problem for customers? I can see how customers might miss this step and have to go to the community for help. However, with good documentation, we can mitigate this problem. As well, this would only affect customers that were trying out the experimental signals. Another downside is there would be a package floating around after v1.15.0 (opentelemetry-api-metrics) that we would need to deprecate.

    Thoughts on this?

    discussion release:required-for-ga 
    opened by lzchen 31
  • Add support for user defined attributes in OTLPHandler

    Add support for user defined attributes in OTLPHandler

    Description

    This gives users the ability to inject custom attributes into emitted logs.

    I think this should solve the discussion in https://github.com/open-telemetry/opentelemetry-python/pull/1903/files#r653092699

    Type of change

    Please delete options that are not relevant.

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [x] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • [ ] This change requires a documentation update

    How Has This Been Tested?

    I added 2 tests for the functionality verifying that the attributes end up in the emitted LogRecord and that the user can specify a sub-key to pull attributes from.

    Does This PR Require a Contrib Repo Change?

    • [ ] Yes. - Link to PR:
    • [x] No.

    Checklist:

    • [x] Followed the style guidelines of this project
    • [x] Changelogs have been updated
    • [x] Unit tests have been added
    • [ ] Documentation has been updated
    opened by adriangb 30
  • Decide supported Python 3.x versions (current code is 3.4+)

    Decide supported Python 3.x versions (current code is 3.4+)

    In #14 we decided not to support Python 2. But with the current code base, we do not even support 3.6, even though setup.py claims we support 3.4. While it would be nice to be on 3.7 only, I think we should at the very least support 3.6. Demo:

    user@pc:~/opentelemetry-python/opentelemetry-api$ cat /etc/issue.net
    Ubuntu 18.04.2 LTS
    user@pc:~/opentelemetry-python/opentelemetry-api$ python3 --version # Note that this is the latest Python version in this Ubuntu version
    Python 3.6.8
    user@pc:~/opentelemetry-python/opentelemetry-api$ python3 -c 'import opentelemetry.trace'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/mnt/c/workspaces/misc/opentelemetry-python/opentelemetry-api/opentelemetry/trace/__init__.py", line 65
        from __future__ import annotations
        ^
    SyntaxError: future feature annotations is not defined
    

    This is PEP 563 which requires 3.7.

    Type hints in general seem to be supported since 3.5 / PEP 484. But note that instance/class variable type hints would only be available since 3.6 (PEP 526).

    discussion meta 
    opened by Oberon00 27
  • Application hangs if Otel collector is down

    Application hangs if Otel collector is down

    I initialize the tracer like this:

        trace.set_tracer_provider(TracerProvider(
            resource=Resource.create({SERVICE_NAME: service}),
        ))
    
        otlp_exporter = OTLPSpanExporter(endpoint="http://otel-collector:4317", insecure=True)
    
        trace.get_tracer_provider().add_span_processor(
            SimpleSpanProcessor(otlp_exporter)
        )
    

    It seems that if the otel-collector is down, the entire application hangs and r=then crashes once it tries to send a span to the collector

    I would expect that maybe it would send a warning or give an error, but it should not hang the entire application.

    Is there a way to avoid this?

    bug backlog 
    opened by gionapaolini 25
  • Adds user agent string to grpc headers

    Adds user agent string to grpc headers

    Description

    Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

    Fixes https://github.com/open-telemetry/opentelemetry-python/issues/2958

    Type of change

    Please delete options that are not relevant.

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • [ ] This change requires a documentation update

    How Has This Been Tested?

    Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

    • [ ] Test A

    Does This PR Require a Contrib Repo Change?

    Answer the following question based on these examples of changes that would require a Contrib Repo Change:

    • The OTel specification has changed which prompted this PR to update the method interfaces of opentelemetry-api/ or opentelemetry-sdk/

    • The method interfaces of test/util have changed

    • Scripts in scripts/ that were copied over to the Contrib repo have changed

    • Configuration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in

      • pyproject.toml
      • isort.cfg
      • .flake8
    • When a new .github/CODEOWNER is added

    • Major changes to project information, such as in:

      • README.md
      • CONTRIBUTING.md
    • [ ] Yes. - Link to PR:

    • [ ] No.

    Checklist:

    • [ ] Followed the style guidelines of this project
    • [ ] Changelogs have been updated
    • [ ] Unit tests have been added
    • [ ] Documentation has been updated
    opened by pridhi-arora 23
  • Make setters and getters optional

    Make setters and getters optional

    This PR makes optional the setters and getters from inject and extract.

    Fixes #1644

    Description

    Removes setters and getters

    Type of change

    Please delete options that are not relevant.

    • [X] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • [ ] This change requires a documentation update

    How Has This Been Tested?

    Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

    • [ ] Test A

    Does This PR Require a Contrib Repo Change?

    • [x] Yes. - Link to PR: https://github.com/open-telemetry/opentelemetry-python-contrib/pull/372
    • [ ] No.

    Checklist:

    • [ ] Followed the style guidelines of this project
    • [ ] Changelogs have been updated
    • [ ] Unit tests have been added
    • [ ] Documentation has been updated
    opened by ocelotl 23
  • Span should have a getter for attributes

    Span should have a getter for attributes

    Currently there are multiple places in the code that make the assumption that a Span has an attributes attribute, this is not always the case.

    The solution could be to implement an attributes property on the Span interface, or we could implement a separate getter method.

    bug 
    opened by codeboten 23
  • Update package metadata opentelemetry-api

    Update package metadata opentelemetry-api

    Background

    Hello there! The Python packaging ecosystem has standardized on the interface for build backends (PEP 517/PEP 660) and the format for metadata declaration (PEP 621/PEP 631). As a result, the execution of setup.py files is now deprecated.

    So, I'm spending my free time updating important projects so that they are modernized and set an example for others 😄

    Description

    This implements PEP 621 for opentelemetry-api, obviating the need for setup.py, setup.cfg, and MANIFEST.in. Our tooling already supports this. I'll open one PR per package after this one.

    The build backend hatchling (of which I am a maintainer in the PyPA) is now used as that is the default in the official Python packaging tutorial. Hatchling is available on all the major distribution channels such as Debian, Fedora, Arch Linux, conda-forge, Nixpkgs, Alpine Linux, FreeBSD, Gentoo Linux, MacPorts, OpenEmbedded, Spack, etc.

    Type of change

    • [X] This change requires a documentation update

    How Has This Been Tested?

    tox -e py38-opentelemetry-api
    

    Does This PR Require a Contrib Repo Change?

    • [ ] Yes. - Link to PR:
    • [X] No.

    Checklist:

    • [ ] Followed the style guidelines of this project
    • [ ] Changelogs have been updated
    • [ ] Unit tests have been added
    • [X] Documentation has been updated
    Skip Changelog 
    opened by ofek 22
  • Trying to develop an instrumentation for SimpleQueue (for threading/multiprocessing)

    Trying to develop an instrumentation for SimpleQueue (for threading/multiprocessing)

    Hello everyone.

    As we have a lot of multi-threading and multiprocessing, I am trying to find a way to cover all/most of those cases, I took a look at the existing instrumentations (like the Redis one), and I am basically trying to wrap the get/set methods from the SimpleQueue class that is used everywhere for data exchange between the threads and processes (in the python multiprocessing module), but so far no luck,

    It looks some code is not using the overrided versions of my methods. I am not very familiar with this kind of monkeypatching, maybe what I am trying to do is not doable (restrictions on stlib or so ?)

    This is what I have been trying to do (with temporary print statements)

    from dataclasses import dataclass
    from opentelemetry import context as otel_context
    from wrapt import wrap_function_wrapper
    
    @dataclass
    class InstrumentedQueueItem:
        otel_context: otel_context.Context
        item: object
    
    def instrument_simple_queue():
        """
        This function patches the SimpleQueue class used to communicate between processes.
        It allows opentelemetry context to be passed between the processes to allow traces to be continuous between
        the different processes.
        SimpleQueue is used internally by the multiprocessing library
        """
    
        def instrument_put(func, instance, args, kwargs):
            print(f"PUT ORIG {len(args)} {args} {kwargs}")
            if len(args) == 1:
                print("Patching ARGS")
                args = list(args)
                args[0] = InstrumentedQueueItem(otel_context=otel_context.get_current(), item=args[0])
                args = tuple(args)
            elif "item" in kwargs:
                print("Patching KWARGS")
                kwargs["item"] = InstrumentedQueueItem(otel_context=otel_context.get_current(), item=kwargs["item"])
            print(f"PUT PATCHED {args} {kwargs}")
            return func(*args, **kwargs)
    
        def instrument_get(func, instance, args, kwargs):
            wrapped_item = func(*args, **kwargs)
            print(f"GET {wrapped_item}")
            if type(wrapped_item) is InstrumentedQueueItem:
                otel_context.attach(wrapped_item.otel_context)
                return wrapped_item.item
            else:
                log.warning(f"Got an uninstrumented item from patched SimpleQueue: {wrapped_item}")
                return wrapped_item
    
        def instrument_handle_results(func, instance, args, kwargs):
            args = list(args)
            old_get = args[1]
    
            def result_parser():
                wrapped_item = old_get()
                print(f"RESULT {wrapped_item}")
                if type(wrapped_item) is InstrumentedQueueItem:
                    otel_context.attach(wrapped_item.otel_context)
                    wrapped_item = wrapped_item.item
                return wrapped_item
    
            args[1] = result_parser
    
            return func(*tuple(args), **kwargs)
    
        wrap_function_wrapper('multiprocessing.queues', 'SimpleQueue.get', instrument_get)
        wrap_function_wrapper('multiprocessing.queues', 'SimpleQueue.put', instrument_put)
        wrap_function_wrapper('multiprocessing.pool', 'Pool._handle_results', instrument_handle_results)
    

    And a simple test

    from multiprocessing import Pool
    import requests
    
    init_opentelemetry()
    
    def f(x):
        return requests.get(x)
    
    if __name__ == '__main__':
        with Pool(5) as p:
            print(p.map(f, ["https://webhook.site/a256ce57-1b3f-4e15-b39c-7a564c001b9f"]))
    

    The kind of error I am getting (a get before a put, and the put is apparently not instrumented, apparently it's running before my patching but how?)

    GET (0, 0, <function mapstar at 0x7f6464fcde50>, ((<function f at 0x7f6464fcd700>, ('https://webhook.site/a256ce57-1b3f-4e15-b39c-7a564c001b9f',)),), {})
    Got an uninstrumented item from patched SimpleQueue: (0, 0, <function mapstar at 0x7f6464fcde50>, ((<function f at 0x7f6464fcd700>, ('https://webhook.site/a256ce57-1b3f-4e15-b39c-7a564c001b9f',)),), {})
    PUT ORIG 1 ((0, 0, (True, [<Response [200]>])),) {}
    Patching ARGS
    PUT PATCHED (InstrumentedQueueItem(otel_context={}, item=(0, 0, (True, [<Response [200]>]))),) {}
    Exception in thread Thread-3:
    Traceback (most recent call last):
      File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
        self.run()
      File "/usr/local/lib/python3.8/threading.py", line 870, in run
        self._target(*self._args, **self._kwargs)
      File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 590, in _handle_results
        job, i, obj = task
    TypeError: cannot unpack non-iterable InstrumentedQueueItem object
    

    Thank you

    opened by kedare 1
  • Trace execution with ConsoleSpanExporter in Windows returns identical timestamps

    Trace execution with ConsoleSpanExporter in Windows returns identical timestamps

    Working with OpenTelemetry in Python for the first time today, seeing an odd issue where timestamps come out identical in most cases when running in a Windows Professional/Enterprise environment. I've seen some uniqueness in the timestamps rarely, and usually right after starting or restarting the Flask app, and only the first run after the restart.

    Describe your environment Windows 10 Enterprise 20H2 19042.2364 (VMware VDI) & Windows 11 Professional for Workstations 22H2 22621.963 (bare metal) Python 3.8.10 && 3.9.13 Flask==2.2.2 opentelemetry-api==1.15.0 opentelemetry-sdk==1.15.0

    Steps to reproduce Primarily followed guide here: Tutorial on Timescale.com.

    from random import randint
    from flask import Flask, request
    
    from opentelemetry import trace
    from opentelemetry.sdk.trace import TracerProvider
    from opentelemetry.sdk.trace.export import (BatchSpanProcessor, ConsoleSpanExporter)
    
    trace.set_tracer_provider(TracerProvider())
    trace.get_tracer_provider().add_span_processor(
        BatchSpanProcessor(ConsoleSpanExporter())
    )
    tracer = trace.get_tracer(__name__)
    
    app = Flask(__name__)
    
    
    @app.route("/roll")
    def roll():
        with tracer.start_as_current_span(
            "server_request",
            attributes={"endpoint": "/roll"}
        ):
    
            sides = int(request.args.get('sides'))
            rolls = int(request.args.get('rolls'))
            return roll_sum(sides, rolls)
    
    
    def roll_sum(sides, rolls):
        span = trace.get_current_span()
        total = 0
        for r in range(0, rolls):
            result = randint(1, sides)
            span.add_event("log", {
                "roll.sides": sides,
                "roll.result": result,
            })
            total += result
        return str(total)
    
    1. Start flask: flask run
    2. In a browser or curl: http://127.0.0.1:5000/roll?sides=10&rolls=5
    3. View output in console.

    What is the expected behavior? Expectation is to see unique timestamps across each recording in the output telemetry, parent and children. Expected output below is from the same code running on a RHEL8 server with Python 3.8.10.

    {
        "name": "server_request",
        "context": {
            "trace_id": "0x79701fdaefb5c04219fbd1ee525d7ca1",
            "span_id": "0x7a1ccfac8fd5177d",
            "trace_state": "[]"
        },
        "kind": "SpanKind.INTERNAL",
        "parent_id": null,
        "start_time": "2022-12-29T23:05:08.879293Z",
        "end_time": "2022-12-29T23:05:08.879470Z",
        "status": {
            "status_code": "UNSET"
        },
        "attributes": {
            "endpoint": "/roll"
        },
        "events": [
            {
                "name": "log",
                "timestamp": "2022-12-29T23:05:08.879411Z",
                "attributes": {
                    "roll.sides": 10,
                    "roll.result": 10
                }
            },
            {
                "name": "log",
                "timestamp": "2022-12-29T23:05:08.879427Z",
                "attributes": {
                    "roll.sides": 10,
                    "roll.result": 8
                }
            },
            {
                "name": "log",
                "timestamp": "2022-12-29T23:05:08.879439Z",
                "attributes": {
                    "roll.sides": 10,
                    "roll.result": 9
                }
            },
            {
                "name": "log",
                "timestamp": "2022-12-29T23:05:08.879449Z",
                "attributes": {
                    "roll.sides": 10,
                    "roll.result": 3
                }
            },
            {
                "name": "log",
                "timestamp": "2022-12-29T23:05:08.879459Z",
                "attributes": {
                    "roll.sides": 10,
                    "roll.result": 3
                }
            }
        ],
        "links": [],
        "resource": {
            "attributes": {
                "telemetry.sdk.language": "python",
                "telemetry.sdk.name": "opentelemetry",
                "telemetry.sdk.version": "1.15.0",
                "service.name": "unknown_service"
            },
            "schema_url": ""
        }
    }
    

    What is the actual behavior? When running this code in Windows, in about 90% of cases all timestamps are the same.

    {
        "name": "server_request",
        "context": {
            "trace_id": "0x390a9c2d3f3daa9a6eca6f82d5bbb112",
            "span_id": "0x17451d6f7e56eef1",
            "trace_state": "[]"
        },
        "kind": "SpanKind.INTERNAL",
        "parent_id": null,
        "start_time": "2022-12-29T23:14:47.350048Z",
        "end_time": "2022-12-29T23:14:47.350048Z",
        "status": {
            "status_code": "UNSET"
        },
        "attributes": {
            "endpoint": "/roll"
        },
        "events": [
            {
                "name": "log",
                "timestamp": "2022-12-29T23:14:47.350048Z",
                "attributes": {
                    "roll.sides": 10,
                    "roll.result": 6
                }
            },
            {
                "name": "log",
                "timestamp": "2022-12-29T23:14:47.350048Z",
                "attributes": {
                    "roll.sides": 10,
                    "roll.result": 2
                }
            },
            {
                "name": "log",
                "timestamp": "2022-12-29T23:14:47.350048Z",
                "attributes": {
                    "roll.sides": 10,
                    "roll.result": 8
                }
            },
            {
                "name": "log",
                "timestamp": "2022-12-29T23:14:47.350048Z",
                "attributes": {
                    "roll.sides": 10,
                    "roll.result": 10
                }
            },
            {
                "name": "log",
                "timestamp": "2022-12-29T23:14:47.350048Z",
                "attributes": {
                    "roll.sides": 10,
                    "roll.result": 2
                }
            }
        ],
        "links": [],
        "resource": {
            "attributes": {
                "telemetry.sdk.language": "python",
                "telemetry.sdk.name": "opentelemetry",
                "telemetry.sdk.version": "1.15.0",
                "service.name": "unknown_service"
            },
            "schema_url": ""
        }
    }
    

    Additional context Add any other context about the problem here.

    bug 
    opened by mchamlee 0
  • Generate default endpoint for metric, trace in grpc

    Generate default endpoint for metric, trace in grpc

    How about pushing value of endpoint in OTLPSpanExporter, OTLPMetricExporter which generated by OTEL_EXPORTER_OTLP_ENDPOINT like http?

    e.g. Trace

    https://github.com/open-telemetry/opentelemetry-python/blob/main/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/trace_exporter/init.py#L78

    https://github.com/open-telemetry/opentelemetry-python/blob/main/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/init.py#L83

            self._endpoint = endpoint or environ.get(
                OTEL_EXPORTER_OTLP_TRACES_ENDPOINT,
                _append_trace_path(
                    environ.get(OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_ENDPOINT)
                ),
            )
    
    feature-request 
    opened by jungrae-prestolabs 2
  • Using `get_tracer` removes all warnings filters

    Using `get_tracer` removes all warnings filters

    In https://github.com/open-telemetry/opentelemetry-python/pull/3041, a DeprecationWarning is ignored by adding a temporary warning filter and then later using warnings.resetfilters to remove it. However, warnings.resetfilters seems to clear every filters, including the default ones. This means that instrumenting code can enable noisy warning logging that is usually suppressed by default.

    There is a context manager that can be used for temporarily changing the warning filters (https://docs.python.org/3/library/warnings.html#warnings.catch_warnings), but its documentation mentions that it is not thread-safe, so it maybe it wouldn't be appropriate for this library...


    Describe your environment Python 3.10, macOS and Linux (via Docker), otel-python v1.15.0 & 0.36b0

    Steps to reproduce Using the example Django app in this repo

    1. Modify the view to emit a (normally ignored) warning and to log the current filters
    diff --git a/docs/examples/django/pages/views.py b/docs/examples/django/pages/views.py
    index e805f4318..8f9e3bdd8 100644
    --- a/docs/examples/django/pages/views.py
    +++ b/docs/examples/django/pages/views.py
    @@ -28,4 +28,8 @@ trace.get_tracer_provider().add_span_processor(
    
    
     def home_page_view(request):
    +    import warnings
    +    warnings.warn("hello", ResourceWarning)
    +    print("--- warnings.filters ---")
    +    print(warnings.filters)
    +    print("------------------------")
         return HttpResponse("Hello, world")
    
    1. Start the server with python manage.py runserver --noreload

    2. Open http://127.0.0.1:8000/,

    3. Stop the server with ctrl-c

    We see the following in the console:

    With instrumentation:

    ...
    ~/.../opentelemetry-python/docs/examples/django/pages/views.py:32: ResourceWarning: hello
      warnings.warn("hello", ResourceWarning)
    --- warnings.filters ---
    []
    ------------------------
    [21/Dec/2022 12:34:56] "GET / HTTP/1.1" 200 12
    {
      ... // otel trace
    }
    ^Csys:1: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 8000)>
    ResourceWarning: Enable tracemalloc to get the object allocation traceback
    

    Without instrumentation (i.e. commenting out DjangoInstrumentor().instrument() in manage.py)

    ...
    --- warnings.filters ---
    [('default', None, <class 'DeprecationWarning'>, '__main__', 0), ('ignore', None, <class 'DeprecationWarning'>, None, 0), ('ignore', None, <class 'PendingDeprecationWarning'>, None, 0), ('ignore', None, <class 'ImportWarning'>, None, 0), ('ignore', None, <class 'ResourceWarning'>, None, 0), ('ignore', None, <class 'pkg_resources.PEP440Warning'>, None, 0)]
    ------------------------
    [21/Dec/2022 12:34:56] "GET / HTTP/1.1" 200 12
    ^C 
    

    Additional context

    The default warnings filters are preserved when using versions 1.14.0 and 0.35b0.

    bug 
    opened by rafikdraoui 0
  • PeriodicExportingMetricReader will continue collection times out (#3098)

    PeriodicExportingMetricReader will continue collection times out (#3098)

    Description

    In cases where collection times out, the period exporting reader thread should not terminate, but instead catch, log, and continue on after the regular interval seconds.

    Prior to this commit, a metric collection timeout would terminate the thread and stop reporting metrics to the wrapped exporter resulting in the appearance in observability tooling of metrics just stopping without reason.

    Fixes #3098

    Type of change

    • [x] Bug fix (non-breaking change which fixes an issue)

    How Has This Been Tested?

    • [X] Added a new test to ensure the OtelPeriodicExportingMetricReader thread remains alive after a MetricsTimeoutError timeout error is raised by the collection process
    • [X] Added a new test to ensure the OtelPeriodicExportingMetricReader thread is killed for other exception types

    Does This PR Require a Contrib Repo Change?

    • [ ] Yes. - Link to PR:
    • [X] No. This is an SDK bugfix only.

    Checklist:

    • [X] Followed the style guidelines of this project
    • [ ] Changelogs have been updated
    • [X] Unit tests have been added
    • [ ] Documentation has been updated
    opened by markallanson 2
Releases(v1.15.0)
  • v1.15.0(Dec 9, 2022)

    • Regenerate opentelemetry-proto to be compatible with protobuf 3 and 4 (#3070)
    • Rename parse_headers to parse_env_headers and improve error message (#2376)
    • Add url decode values from OTEL_RESOURCE_ATTRIBUTES (#3046)
    • Fixed circular dependency issue with custom samplers (#3026)
    • Add missing entry points for OTLP/HTTP exporter (#3027)
    • Update logging to include logging api as per specification (#3038)
    • Fix: Avoid generator in metrics _ViewInstrumentMatch.collect() (#3035
    • [exporter-otlp-proto-grpc] add user agent string (#3009)
    Source code(tar.gz)
    Source code(zip)
  • v1.14.0(Nov 3, 2022)

    • Add logarithm and exponent mappings (#2960)
    • Add and use missing metrics environment variables (#2968)
    • Enabled custom samplers via entry points (#2972)
    • Update log symbol names (#2943)
    • Update explicit histogram bucket boundaries (#2947)
    • exporter-otlp-proto-http: add user agent string (#2959)
    • Add http-metric instrument names to semantic conventions (#2976)
    • [exporter/opentelemetry-exporter-otlp-proto-http] Add OTLPMetricExporter (#2891)
    • Add support for py3.11 (#2997)
    • Fix a bug with exporter retries for with newer versions of the backoff library (#2980)
    Source code(tar.gz)
    Source code(zip)
  • v1.13.0(Sep 26, 2022)

    What's Changed

    • Stop MeterProvier attribute error message from showing up by @ocelotl in https://github.com/open-telemetry/opentelemetry-python/pull/2875
    • Update PeriodicExportingMetricReader to never call export() concurrently by @aabmass in https://github.com/open-telemetry/opentelemetry-python/pull/2873
    • Fix typos by @kianmeng in https://github.com/open-telemetry/opentelemetry-python/pull/2868
    • Adding Codespell to the CI by @galbash in https://github.com/open-telemetry/opentelemetry-python/pull/2878
    • Skip LICENSE files for spellcheck by @srikanthccv in https://github.com/open-telemetry/opentelemetry-python/pull/2879
    • Add param for indent size to LogRecord.to_json() by @dougramirez in https://github.com/open-telemetry/opentelemetry-python/pull/2870
    • Remove LogEmitter.flush() to align with OTel Log Spec by @pranavmarla in https://github.com/open-telemetry/opentelemetry-python/pull/2863
    • Mark test as flaky by @ocelotl in https://github.com/open-telemetry/opentelemetry-python/pull/2886
    • Remove support for 3.6 by @ocelotl in https://github.com/open-telemetry/opentelemetry-python/pull/2763
    • Update package metadata opentelemetry-api by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2867
    • Refactor testing console exporter by @ocelotl in https://github.com/open-telemetry/opentelemetry-python/pull/2877
    • Update package metadata opentelemetry-proto by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2905
    • Update package metadata opentelemetry-sdk by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2906
    • Update package metadata opentelemetry-semantic-conventions by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2907
    • Update package metadata opentelemetry-propagator-b3 by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2908
    • Update package metadata opentelemetry-propagator-jaeger by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2909
    • Update package metadata opentelemetry-exporter-jaeger-thrift by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2896
    • Update package metadata opentelemetry-exporter-zipkin-json by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2903
    • Update package metadata opentelemetry-exporter-opencensus by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2897
    • Update package metadata opentelemetry-exporter-zipkin-proto-http by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2904
    • Update package metadata opentelemetry-exporter-zipkin by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2902
    • Update package metadata opentelemetry-exporter-prometheus by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2901
    • Update package metadata opentelemetry-exporter-otlp-proto-http by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2900
    • Update package metadata opentelemetry-exporter-otlp-proto-grpc by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2899
    • Update package metadata opentelemetry-exporter-jaeger-proto-grpc by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2895
    • Update package metadata opentelemetry-exporter-otlp by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2898
    • Update package metadata opentelemetry-exporter-jaeger by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2894
    • Update package metadata opentelemetry-opentracing-shim by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2912
    • Update package metadata docs/examples/error_handler by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2914
    • Update package metadata opentelemetry-test-utils by @ofek in https://github.com/open-telemetry/opentelemetry-python/pull/2913
    • Update README.md by @srikanthccv in https://github.com/open-telemetry/opentelemetry-python/pull/2916
    • Adding support for setting OTLP exporter protocol by env vars by @ronyis in https://github.com/open-telemetry/opentelemetry-python/pull/2893
    • Fix preferred_aggregation + preferred_temporality example by @lzchen in https://github.com/open-telemetry/opentelemetry-python/pull/2911
    • Bump API/SDK version for exporters by @srikanthccv in https://github.com/open-telemetry/opentelemetry-python/pull/2918
    • Add a configurable max_export_batch_size to the gRPC metrics exporter by @overmeulen in https://github.com/open-telemetry/opentelemetry-python/pull/2809
    • Update scripts and lint configs by @srikanthccv in https://github.com/open-telemetry/opentelemetry-python/pull/2929
    • Update contrib repo SHA by @ocelotl in https://github.com/open-telemetry/opentelemetry-python/pull/2937
    • Add force_flush to span exporters by @srikanthccv in https://github.com/open-telemetry/opentelemetry-python/pull/2919
    • Update scripts by @srikanthccv in https://github.com/open-telemetry/opentelemetry-python/pull/2944
    • updating changelogs and version to 1.13.0-0.34b0 by @srikanthccv in https://github.com/open-telemetry/opentelemetry-python/pull/2950

    New Contributors

    • @kianmeng made their first contribution in https://github.com/open-telemetry/opentelemetry-python/pull/2868
    • @galbash made their first contribution in https://github.com/open-telemetry/opentelemetry-python/pull/2878
    • @dougramirez made their first contribution in https://github.com/open-telemetry/opentelemetry-python/pull/2870
    • @pranavmarla made their first contribution in https://github.com/open-telemetry/opentelemetry-python/pull/2863
    • @ofek made their first contribution in https://github.com/open-telemetry/opentelemetry-python/pull/2867
    • @ronyis made their first contribution in https://github.com/open-telemetry/opentelemetry-python/pull/2893

    Full Changelog: https://github.com/open-telemetry/opentelemetry-python/compare/v1.12.0...v1.13.0

    Source code(tar.gz)
    Source code(zip)
  • v1.12.0(Aug 9, 2022)

    • Add force_flush method to metrics exporter (#2852)
    • Change tracing to use Resource.to_json() (#2784)
    • Fix get_log_emitter instrumenting_module_version args typo (#2830)
    • Fix OTLP gRPC exporter warning message (#2781)
    • Fix tracing decorator with late configuration (#2754)
    • Fix --insecure of CLI argument (#2696)
    • Add temporality and aggregation configuration for metrics exporters, use OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE only for OTLP metrics exporter (#2843)
    • Instrument instances are always created through a Meter (#2844)
    Source code(tar.gz)
    Source code(zip)
  • v1.12.0rc2(Jul 4, 2022)

    • Fix instrument name and unit regexes (#2796)
    • Add optional sessions parameter to all Exporters leveraging requests.Session (#2783)
    • Add min/max fields to Histogram (#2759)
    • opentelemetry-exporter-otlp-proto-http Add support for OTLP/HTTP log exporter (#2462)
    • Fix yield of None-valued points (#2745)
    • Add missing to_json methods (#2722
    • Fix type hints for textmap Getter and Setter (#2657)
    • Fix LogEmitterProvider.force_flush hanging randomly (#2714)
    • narrow protobuf dependencies to exclude protobuf >= 4 (#2720)
    • Specify worker thread names (#2724)
    • Loosen dependency on backoff for newer Python versions (#2726)
    • fix: frozenset object has no attribute items (#2727)
    • fix: create suppress HTTP instrumentation key in opentelemetry context (#2729)
    • Support logs SDK auto instrumentation enable/disable with env (#2728)
    • fix: update entry point object references for metrics (#2731)
    • Allow set_status to accept the StatusCode and optional description (#2735)
    • Configure auto instrumentation to support metrics (#2705)
    • Add entrypoint for metrics exporter (#2748)
    • Fix Jaeger propagator usage with NonRecordingSpan (#2762)
    • Add opentelemetry.propagate module and opentelemetry.propagators package to the API reference documentation (#2785)
    Source code(tar.gz)
    Source code(zip)
  • v1.12.0rc1(May 17, 2022)

    • Fix LoggingHandler to handle LogRecord with exc_info=False (#2690)
    • Make metrics components public (#2684)
    • Update to semantic conventions v1.11.0 (#2669)
    • Update opentelemetry-proto to v0.17.0 (#2668)
    • Add CallbackOptions to observable instrument callback params (#2664)
    • Add timeouts to metric SDK (#2653)
    • Add variadic arguments to metric exporter/reader interfaces (#2654)
    • Added a opentelemetry.sdk.resources.ProcessResourceDetector that adds the 'process.runtime.{name,version,description}' resource attributes when used with the opentelemetry.sdk.resources.get_aggregated_resources API (#2660)
    • Move Metrics API behind internal package (#2651)

    This release includes the release candidate for metrics.

    Source code(tar.gz)
    Source code(zip)
  • v1.11.1(Apr 21, 2022)

    • Fix unhandled callback exceptions on async instruments (#2614)
    • Rename DefaultCounter, DefaultHistogram, DefaultObservableCounter, DefaultObservableGauge, DefaultObservableUpDownCounter, DefaultUpDownCounter instruments to NoOpCounter, NoOpHistogram, NoOpObservableCounter, NoOpObservableGauge, NoOpObservableUpDownCounter, NoOpUpDownCounter (#2616)
    • Deprecate InstrumentationLibraryInfo and Add InstrumentationScope (#2583)
    Source code(tar.gz)
    Source code(zip)
  • v1.11.0(Apr 18, 2022)

    • Add support for zero or more callbacks (#2602)
    • Fix parsing of trace flags when extracting traceparent (#2577)
    • Add default aggregation (#2543)
    • Fix incorrect installation of some exporter “convenience” packages into “site-packages/src” (#2525)
    • Capture exception information as part of log attributes (#2531)
    • Change OTLPHandler to LoggingHandler (#2528)
    • Fix delta histogram sum not being reset on collection (#2533)
    • Add InMemoryMetricReader to metrics SDK (#2540)
    • Drop the usage of name field from log model in OTLP (#2565)
    • Update opentelemetry-proto to v0.15.0 (#2566)
    • Remove enable_default_view option from sdk MeterProvider (#2547)
    • Update otlp-proto-grpc and otlp-proto-http exporters to have more lax requirements for backoff lib (#2575)
    • Add min/max to histogram point (#2581)
    Source code(tar.gz)
    Source code(zip)
  • v1.10.0(Mar 11, 2022)

    • Docs rework: non-API docs are moving to opentelemetry.io. For details, including a list of pages that have moved, see #2453, and #2498.
    • opentelemetry-exporter-otlp-grpc update SDK dependency to ~1.9. (#2442)
    • bugfix(auto-instrumentation): attach OTLPHandler to root logger (#2450)
    • Bump semantic conventions from 1.6.1 to 1.8.0 (#2461)
    • fix exception handling in get_aggregated_resources (#2464)
    • Fix OTEL_EXPORTER_OTLP_ENDPOINT usage in OTLP HTTP trace exporter (#2493)
    • [exporter/opentelemetry-exporter-prometheus] restore package using the new metrics API (#2321)
    Source code(tar.gz)
    Source code(zip)
  • v1.9.1(Jan 31, 2022)

  • v1.9.0(Jan 26, 2022)

    Changes

    • Fix SpanLimits global span limit defaulting when set to 0 (#2398)
    • Add Python version support policy (#2397)
    • Decode URL-encoded headers in environment variables (#2312)
    • [exporter/opentelemetry-exporter-otlp-proto-grpc] Add OTLPMetricExporter (#2323)
    • Complete metric exporter format and update OTLP exporter (#2364)
    • [api] Add NoOpTracer and NoOpTracerProvider. Marking _DefaultTracer and _DefaultTracerProvider as deprecated. (#2363)
    • [exporter/opentelemetry-exporter-otlp-proto-grpc] Add Sum to OTLPMetricExporter (#2370)
    • [api] Rename _DefaultMeter and _DefaultMeterProvider to NoOpMeter and NoOpMeterProvider. (#2383)
    • [exporter/opentelemetry-exporter-otlp-proto-grpc] Add Gauge to OTLPMetricExporter (#2408)
    • [logs] prevent None from causing problems (#2410)
    Source code(tar.gz)
    Source code(zip)
  • v1.8.0(Dec 17, 2021)

    ##Changes

    • Adds Aggregation and instruments as part of Metrics SDK (#2234)
    • Update visibility of OTEL_METRICS_EXPORTER environment variable (#2303)
    • Adding entrypoints for log emitter provider and console, otlp log exporters (#2253)
    • Rename ConsoleExporter to ConsoleLogExporter (#2307)
    • Adding OTEL_LOGS_EXPORTER environment variable (#2320)
    • Add otlp entrypoint for log exporter (#2322)

    Happy Holidays 🎅 ☃️

    Source code(tar.gz)
    Source code(zip)
  • v1.7.1(Nov 11, 2021)

    Highlights

    • Experimental release for logging SDK 🎉 (https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-sdk/src/opentelemetry/sdk/_logs)
    • Python 3.10 is now officially supported 🎉

    Changelog

    • Add support for Python 3.10 (#2207)
    • remove X-B3-ParentSpanId for B3 propagator as per OpenTelemetry specification (#2237)
    • Populate auto.version in Resource if using auto-instrumentation (#2243)
    • Return proxy instruments from ProxyMeter [#2169]
    • Make Measurement a concrete class (#2153)
    • Add metrics API (#1887)
    • Make batch processor fork aware and reinit when needed (#2242)
    • opentelemetry-sdk Sanitize env var resource attribute pairs (#2256)
    • opentelemetry-test start releasing to pypi.org (#2269)
    Source code(tar.gz)
    Source code(zip)
  • v1.7.0(Nov 11, 2021)

  • v1.6.2(Oct 19, 2021)

  • v1.6.1(Oct 18, 2021)

    • Upgrade GRPC/protobuf related dependency and regenerate otlp protobufs (#2201)
    • Propagation: only warn about oversized baggage headers when headers exist (#2212)
    • Migrate instrumentation and disro to contrib (#2196)
    Source code(tar.gz)
    Source code(zip)
  • v1.6.0(Oct 13, 2021)

    • Fix race in set_tracer_provider() (#2182)
    • Automatically load OTEL environment variables as options for opentelemetry-instrument (#1969)
    • opentelemetry-semantic-conventions Update to semantic conventions v1.6.1 (#2077)
    • Do not count invalid attributes for dropped (#2096)
    • Fix propagation bug caused by counting skipped entries (#2071)
    • Add entry point for exporters with default protocol (#2093)
    • Do not skip sequence attribute on decode error (#2097)
    • opentelemetry-test: Add HttpTestBase to allow tests with actual TCP sockets (#2101)
    • Fix incorrect headers parsing via environment variables (#2103)
    • Add support for OTEL_ATTRIBUTE_COUNT_LIMIT (#2139)
    • Attribute limits no longer apply to Resource attributes (#2138)
    • opentelemetry-exporter-otlp: Add opentelemetry-otlp-proto-http as dependency (#2147)
    • Fix validity calculation for trace and span IDs (#2145)
    • Add schema_url to TracerProvider.get_tracer (#2154)
    • Make baggage implementation w3c spec complaint (#2167)
    Source code(tar.gz)
    Source code(zip)
  • v1.5.0(Aug 26, 2021)

    Added

    • Add Trace ID validation to meet TraceID spec (#1992)
    • opentelemetry-sdk added support for OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT (#2044)
    • opentelemetry-sdk Add support for OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT env var (#2056)

    Changed

    • opentelemetry-sdk get_aggregated_resource() returns default resource and service name whenever called (#2013)
    • opentelemetry-distro & opentelemetry-sdk Moved Auto Instrumentation Configurator code to SDK to let distros use its default implementation (#1937)
    • opentelemetry-sdk Treat limit even vars set to empty values as unset/unlimited. (#2054)
    • opentelemetry-api Attribute keys must be non-empty strings. (#2057)

    Fixed

    • Fix documentation on well known exporters and variable OTEL_TRACES_EXPORTER which were misnamed (#2023)
    • Fixed Python 3.10 incompatibility in opentelemetry-opentracing-shim tests (#2018)
    • opentelemetry-sdk Fixed bugs (#2041, #2042 & #2045) in Span Limits (#2044)
    Source code(tar.gz)
    Source code(zip)
  • v1.4.1(Jul 28, 2021)

  • v1.4.0(Jul 21, 2021)

    Added

    • opentelemetry-semantic-conventions Generate semconv constants update for OTel Spec 1.5.0 (#1946)
    • Moved opentelemetry-instrumentation to core repository. (#1959)
    • Dropped attributes/events/links count available exposed on ReadableSpans. (#1893)
    • Added dropped count to otlp, jaeger and zipkin exporters. (#1893)

    Changed

    • Updated opentelemetry-opencensus-exporter to use service_name of spans instead of resource (#1897)
    • Added descriptions to the env variables mentioned in the opentelemetry-specification (#1898)
    • Ignore calls to Span.set_status with StatusCode.UNSET and also if previous status already had StatusCode.OK. (#1902)
    • Attributes for Link and Resource are immutable as they are for Event, which means any attempt to modify attributes directly will result in a TypeError exception. (#1909)
    • Added BoundedAttributes to the API to make it available for Link which is defined in the API. Marked BoundedDict in the SDK as deprecated as a result. (#1915)
    • Fix OTLP SpanExporter to distinguish spans based off Resource and InstrumentationInfo (#1927)
    • Updating dependency for opentelemetry api/sdk packages to support major version instead of pinning to specific versions. (#1933)

    Fixed

    • Updated opentelementry-opentracing-shim ScopeShim to report exceptions in opentelemetry specification format, rather than opentracing spec format. (#1878)
    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Jun 2, 2021)

    Added

    • Allow span limits to be set programatically via TracerProvider. (#1877)

    Changed

    • Updated get_tracer to return an empty string when passed an invalid name (#1854)
    • Changed AttributeValue sequences to warn mypy users on adding None values to array (#1855)
    • Fixed exporter OTLP header parsing to match baggage header formatting. (#1869)
    • Added optional schema_url field to Resource class (#1871)
    • Update protos to latest version release 0.9.0 (#1873)
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(May 12, 2021)

    Added

    • Added example for running Django with auto instrumentation. (#1803)
    • Added B3SingleFormat and B3MultiFormat propagators to the opentelemetry-propagator-b3 package. (#1823)
    • Added support for OTEL_SERVICE_NAME. (#1829)

    Changed

    • Fixed OTLP gRPC exporter silently failing if scheme is not specified in endpoint. (#1806)
    • Rename CompositeHTTPPropagator to CompositePropagator as per specification. (#1807)
    • Propagators use the root context as default for extract and do not modify the context if extracting from carrier does not work. (#1811)
    • Fixed b3 propagator entrypoint to point to B3SingleFormat propagator. (#1823)
    • Added b3multi propagator entrypoint to point to B3MultiFormat propagator. (#1823)
    • Improve warning when failing to decode byte attribute (#1810)
    • Fixed inconsistency in parent_id formatting from the ConsoleSpanExporter (#1833)
    • Include span parent in Jaeger gRPC export as CHILD_OF reference ([#1809])(https://github.com/open-telemetry/opentelemetry-python/pull/1809)
    • Fixed sequence values in OTLP exporter not translating (#1818)

    Removed

    • Moved opentelemetry-instrumentation to contrib repository. (#1797)
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Apr 20, 2021)

    1.1.0 - 2021-04-20

    Added

    • Added py.typed file to every package. This should resolve a bunch of mypy errors for users. (#1720)
    • Add auto generated trace and resource attributes semantic conventions (#1759)
    • Added SpanKind to should_sample parameters, suggest using parent span context's tracestate instead of manually passed in tracestate in should_sample (#1764)
    • Added experimental HTTP back propagators. (#1762)

    Changed

    • Adjust B3Format propagator to be spec compliant by not modifying context when propagation headers are not present/invalid/empty (#1728)
    • Silence unnecessary warning when creating a new Status object without description. (#1721)
    • Update bootstrap cmd to use exact version when installing instrumentation packages. (#1722)
    • Fix B3 propagator to never return None. (#1750)
    • Added ProxyTracerProvider and ProxyTracer implementations to allow fetching provider and tracer instances before a global provider is set up. (#1726)
    • Added __contains__ to opentelementry.trace.span.TraceState. (#1773)
    • opentelemetry-opentracing-shim Fix an issue in the shim where a Span was being wrapped in a NonRecordingSpan when it wasn't necessary. (#1776)
    • OTLP Exporter now uses the scheme in the endpoint to determine whether to establish a secure connection or not. (#1771)
    Source code(tar.gz)
    Source code(zip)
  • v1.10a0(Apr 7, 2021)

    This release adds the experimental metrics API/SDK and will include the following packages:

      opentelemetry-exporter-prometheus
      opentelemetry-api
      opentelemetry-sdk
      opentelemetry-exporter-otlp-proto-grpc
      opentelemetry-exporter-otlp
    
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Mar 26, 2021)

    NOTE: As part of this release, all old versions have been removed for packages prefixed with opentelemetry-ext-

    1.0.0 - 2021-03-26

    Added

    • Document how to work with fork process web server models(Gunicorn, uWSGI etc...) (#1609)
    • Add max_attr_value_length support to Jaeger exporter (#1633)
    • Moved use_span from Tracer to opentelemetry.trace.use_span. (#1668)
    • opentelemetry.trace.use_span() will now overwrite previously set status on span in case an exception is raised inside the context manager and set_status_on_exception is set to True. (#1668)
    • Add udp_split_oversized_batches support to jaeger exporter (#1500)

    Changed

    • remove service_name from constructor of jaeger and opencensus exporters and use of env variable OTEL_PYTHON_SERVICE_NAME ([#1669])(https://github.com/open-telemetry/opentelemetry-python/pull/1669)
    • Rename IdsGenerator to IdGenerator (#1651)
    • Make TracerProvider's resource attribute private (#1652)
    • Rename Resource's create_empty to get_empty (#1653)
    • Renamed BatchExportSpanProcessor to BatchSpanProcessor and SimpleExportSpanProcessor to SimpleSpanProcessor (#1656)
    • Rename DefaultSpan to NonRecordingSpan (#1661)
    • Fixed distro configuration with OTEL_TRACES_EXPORTER env var set to otlp (#1657)
    • Moving Getter, Setter and TextMapPropagator out of opentelemetry.trace.propagation and into opentelemetry.propagators (#1662)
    • Rename BaggagePropagator to W3CBaggagePropagator (#1663)
    • Rename JaegerSpanExporter to JaegerExporter and rename ZipkinSpanExporter to ZipkinExporter (#1664)
    • Expose StatusCode from the opentelemetry.trace module (#1681)
    • Status now only sets description when status_code is set to StatusCode.ERROR (#1673)
    • Update OTLP exporter to use OTLP proto 0.7.0 (#1674)
    • Remove time_ns from API and add a warning for older versions of Python (#1602)
    • Hide implementation classes/variables in api/sdk (#1684)
    • Cleanup OTLP exporter compression options, add tests (#1671)
    • Initial documentation for environment variables (#1680)
    • Change Zipkin exporter to obtain service.name from span (#1696)
    • Split up opentelemetry-exporter-jaeger package into opentelemetry-exporter-jaeger-proto-grpc and opentelemetry-exporter-jaeger-thrift packages to reduce dependencies for each one. (#1694)
    • Added opentelemetry-exporter-otlp-proto-grpc and changed opentelemetry-exporter-otlp to install it as a dependency. This will allow for the next package/protocol to also be in its own package. (#1695)
    • Change Jaeger exporters to obtain service.name from span (#1703)
    • Fixed an unset OTEL_TRACES_EXPORTER resulting in an error (#1707)
    • Split Zipkin exporter into opentelemetry-exporter-zipkin-json and opentelemetry-exporter-zipkin-proto-http packages to reduce dependencies. The opentelemetry-exporter-zipkin installs both. (#1699)
    • Make setters and getters optional (#1690)

    Removed

    • Removed unused get_hexadecimal_trace_id and get_hexadecimal_span_id methods. (#1675)
    • Remove OTEL_EXPORTER_*_ INSECURE env var (#1682)
    • Removing support for Python 3.5 (#1706)

    0.19b0 - 2021-03-26

    Changed

    • remove service_name from constructor of jaeger and opencensus exporters and use of env variable OTEL_PYTHON_SERVICE_NAME ([#1669])(https://github.com/open-telemetry/opentelemetry-python/pull/1669)
    • Rename IdsGenerator to IdGenerator (#1651)

    Removed

    • Removing support for Python 3.5 (#1706)
    Source code(tar.gz)
    Source code(zip)
  • v0.18b0(Feb 16, 2021)

    Release only affects Opentelemetry components listed below: opentelemetry-distro opentelemetry-exporter-opencensus opentelemetry-instrumentation opentelemetry-opentracing-shim

    Added

    • Add urllib to opentelemetry-bootstrap target list ([#1584])(https://github.com/open-telemetry/opentelemetry-python/pull/1584)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc1(Feb 12, 2021)

    Release only affects core Opentelemetry components listed below: opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp opentelemetry-exporter-jaeger opentelemetry-exporter-zipkin opentelemetry-proto opentelemetry-propagator-b3 opentelemetry-propagator-jaeger

    Changed

    • Tracer and Meter provider environment variables are now consistent with the rest (#1571])
    • Rename TRACE_ to TRACES_ for environment variables (#1595])
    • Read-only Span attributes have been moved to ReadableSpan class (#1560)

    Added

    • Added end_on_exit argument to start_as_current_span (#1519])
    • Add Span.set_attributes method to set multiple values with one call (#1520)
    • Make sure Resources follow semantic conventions (#1480)
    • Allow missing carrier headers to continue without raising AttributeError (#1545)

    Removed

    • Remove Configuration (#1523)
    • Remove Metrics as part of stable, marked as experimental (#1568)
    Source code(tar.gz)
    Source code(zip)
  • v0.17b0(Jan 20, 2021)

    Added

    • Add support for OTLP v0.6.0 (#1472)
    • Add protobuf via gRPC exporting support for Jaeger (#1471)
    • Add support for Python 3.9 (#1441)
    • Added the ability to disable instrumenting libraries specified by OTEL_PYTHON_DISABLED_INSTRUMENTATIONS env variable, when using opentelemetry-instrument command. (#1461)
    • Add fields to propagators (#1374)
    • Add local/remote samplers to parent based sampler (#1440)
    • Add support for OTEL_SPAN_{ATTRIBUTE_COUNT_LIMIT,EVENT_COUNT_LIMIT,LINK_COUNT_LIMIT} (#1377)
    • Return None for DictGetter if key not found (#1449)
    • Added support for Jaeger propagator (#1219)
    • Remove dependency on SDK from opentelemetry-instrumentation package. The opentelemetry-sdk package now registers an entrypoint opentelemetry_configurator to allow opentelemetry-instrument to load the configuration for the SDK (#1420)
    • opentelemetry-exporter-zipkin Add support for array attributes in Span and Resource exports (#1285)
    • Added __repr__ for DefaultSpan, added trace_flags to __repr__ of SpanContext (#1485])
    • opentelemetry-sdk Add support for OTEL_TRACE_SAMPLER and OTEL_TRACE_SAMPLER_ARG env variables (#1496)
    • Adding opentelemetry-distro package to add default configuration for span exporter to OTLP (#1482)

    Changed

    • opentelemetry-exporter-zipkin Updated zipkin exporter status code and error tag (#1486)
    • Recreate span on every run of a start_as_current_span-decorated function (#1451)
    • opentelemetry-exporter-otlp Headers are now passed in as tuple as metadata, instead of a string, which was incorrect. (#1507)
    • opentelemetry-exporter-jaeger Updated Jaeger exporter status code tag (#1488)
    • opentelemetry-api opentelemety-sdk Moved idsgenerator into sdk (#1514)
    • opentelemetry-sdk The B3Format propagator has been moved into its own package: opentelemetry-propagator-b3 (#1513)
    • Update default port for OTLP exporter from 55680 to 4317 (#1516)
    • opentelemetry-exporter-zipkin Update boolean attribute value transformation (#1509)
    • Move opentelemetry-opentracing-shim out of instrumentation folder (#1533)
    • opentelemetry-sdk The JaegerPropagator has been moved into its own package: opentelemetry-propagator-jaeger (#1525)
    • opentelemetry-exporter-jaeger, opentelemetry-exporter-zipkin Update InstrumentationInfo tag keys for Jaeger and Zipkin exporters (#1535)
    • opentelemetry-sdk Remove rate property setter from TraceIdRatioBasedSampler (#1536)
    • Fix TraceState to adhere to specs (#1502)

    Removed

    • opentelemetry-api Remove ThreadLocalRuntimeContext since python3.4 is not supported. (#1482)
    Source code(tar.gz)
    Source code(zip)
  • v0.16b1(Nov 27, 2020)

  • v0.16b0(Nov 26, 2020)

    One major change done as part of this release was to move the instrumentation out of the core repo and into the contrib repo. This change should not impact users of the published packages, but the release notes for instrumentation packages will now be available in the contrib repo.

    opentelemetry-api

    🚀 Enhancements

    • Add optional parameter to record_exception method (#1314)
    • Add pickle support to SpanContext class (#1380)

    opentelemetry-instrumentation

    🚀 Enhancements

    • Added support for OTEL_EXPORTER to the opentelemetry-instrument command (#1036)
    • Add IDs Generator as Configurable Property of Auto Instrumentation (#1404)
    • Add missing references to instrumented packages (#1416)
    • Instrumentation Package depends on the OTel SDK (#1405)

    opentelemetry-proto

    💥 Breaking Changes

    • Update protobuf versions (#1356)

    opentelemetry-sdk

    💥 Breaking Changes

    • Rename MetricRecord class to ExportRecord (#1367)
    • Rename Record class to Accumulation (#1373)
    • Rename Meter class to Accumulator (#1372)

    🚀 Enhancements)

    • Add optional parameter to record_exception method (#1314)

    • Update exception handling optional parameters, add escaped attribute to record_exception (#1365)

    • Allow samplers to modify tracestate (#1319)
    • Fix ParentBased sampler for implicit parent spans. Fix also trace_state erasure for dropped spans or spans sampled by the TraceIdRatioBased sampler. (#1394)

    opentelemetry-exporter-jaeger

    🚀 Enhancements

    • Fix Jaeger exporter to correctly translate span.kind attribute (#1329)

    opentelemetry-exporter-opencensus

    💥 Breaking Changes

    • Update protobuf versions (#1356)

    opentelemetry-exporter-otlp

    🚀 Enhancements

    • Add Gzip compression for exporter (#1141)
    • Handle error case when no credentials supplied (#1366)
    • Change temporality for Counter and UpDownCounter (#1384)
    • Add instrumentation library name and version to OTLP exported metrics (#1418)

    opentelemetry-exporter-zipkin

    🚀 Enhancements

    • Support for v2 api protobuf format (#1318)
    Source code(tar.gz)
    Source code(zip)
Owner
OpenTelemetry - CNCF
OpenTelemetry makes robust, portable telemetry a built-in feature of cloud-native software.
OpenTelemetry - CNCF
API Documentation for Python Projects

API Documentation for Python Projects. Example pdoc -o ./html pdoc generates this website: pdoc.dev/docs. Installation pip install pdoc pdoc is compat

mitmproxy 1.4k Jan 7, 2023
📖 Generate markdown API documentation from Google-style Python docstring. The lazy alternative to Sphinx.

lazydocs Generate markdown API documentation for Google-style Python docstring. Getting Started • Features • Documentation • Support • Contribution •

Machine Learning Tooling 118 Dec 31, 2022
A swagger tool for tornado, using python to write api doc!

SwaggerDoc About A swagger tool for tornado, using python to write api doc! Installation pip install swagger-doc Quick Start code import tornado.ioloo

aaashuai 1 Jan 10, 2022
A set of Python libraries that assist in calling the SoftLayer API.

SoftLayer API Python Client This library provides a simple Python client to interact with SoftLayer's XML-RPC API. A command-line interface is also in

SoftLayer 155 Sep 20, 2022
Python 3 wrapper for the Vultr API v2.0

Vultr Python Python wrapper for the Vultr API. https://www.vultr.com https://www.vultr.com/api This is currently a WIP and not complete, but has some

CSSNR 6 Apr 28, 2022
Automated Integration Testing and Live Documentation for your API

Automated Integration Testing and Live Documentation for your API

ScanAPI 1.3k Dec 30, 2022
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Introduction Swagger UI allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without

Swagger 23.2k Dec 29, 2022
Data-Scrapping SEO - the project uses various data scrapping and Google autocompletes API tools to provide relevant points of different keywords so that search engines can be optimized

Data-Scrapping SEO - the project uses various data scrapping and Google autocompletes API tools to provide relevant points of different keywords so that search engines can be optimized; as this information is gathered, the marketing team can target the top keywords to get your company’s website higher on a results page.

Vibhav Kumar Dixit 2 Jul 18, 2022
SqlAlchemy Flask-Restful Swagger Json:API OpenAPI

SAFRS: Python OpenAPI & JSON:API Framework Overview Installation JSON:API Interface Resource Objects Relationships Methods Custom Methods Class Method

Thomas Pollet 361 Nov 16, 2022
Create docsets for Dash.app-compatible API browser.

doc2dash: Create Docsets for Dash.app and Clones doc2dash is an MIT-licensed extensible Documentation Set generator intended to be used with the Dash.

Hynek Schlawack 498 Dec 30, 2022
A simple document management REST based API for collaboratively interacting with documents

documan_api A simple document management REST based API for collaboratively interacting with documents.

Shahid Yousuf 1 Jan 22, 2022
🌱 Complete API wrapper of Seedr.cc

Python API Wrapper of Seedr.cc Table of Contents Installation How I got the API endpoints? Start Guide Getting Token Logging with Username and Passwor

Hemanta Pokharel 43 Dec 26, 2022
A python package to avoid writing and maintaining duplicated python docstrings.

docstring-inheritance is a python package to avoid writing and maintaining duplicated python docstrings.

Antoine Dechaume 15 Dec 7, 2022
A comprehensive and FREE Online Python Development tutorial going step-by-step into the world of Python.

FREE Reverse Engineering Self-Study Course HERE Fundamental Python The book and code repo for the FREE Fundamental Python book by Kevin Thomas. FREE B

Kevin Thomas 7 Mar 19, 2022
A collection of simple python mini projects to enhance your python skills

A collection of simple python mini projects to enhance your python skills

PYTHON WORLD 12.1k Jan 5, 2023
Python Eacc is a minimalist but flexible Lexer/Parser tool in Python.

Python Eacc is a parsing tool it implements a flexible lexer and a straightforward approach to analyze documents.

Iury de oliveira gomes figueiredo 60 Nov 16, 2022
Repository for learning Python (Python Tutorial)

Repository for learning Python (Python Tutorial) Languages and Tools ?? Overview ?? Repository for learning Python (Python Tutorial) Languages and Too

Swiftman 2 Aug 22, 2022
advance python series: Data Classes, OOPs, python

Working With Pydantic - Built-in Data Process ========================== Normal way to process data (reading json file): the normal princiople, it's f

Phung Hưng Binh 1 Nov 8, 2021
A simple USI Shogi Engine written in python using python-shogi.

Revengeshogi My attempt at creating a USI Shogi Engine in python using python-shogi. Current State of Engine Currently only generating random moves us

null 1 Jan 6, 2022