opentelemetry-propagator-gcp


Nameopentelemetry-propagator-gcp JSON
Version 1.7.0 PyPI version JSON
download
home_pagehttps://github.com/GoogleCloudPlatform/opentelemetry-operations-python/tree/main/opentelemetry-propagator-gcp
SummaryGoogle Cloud propagator for OpenTelemetry
upload_time2024-08-27 19:25:54
maintainerNone
docs_urlNone
authorGoogle
requires_python>=3.7
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            OpenTelemetry Google Cloud Propagator
======================================

.. image:: https://badge.fury.io/py/opentelemetry-propagator-gcp.svg
    :target: https://badge.fury.io/py/opentelemetry-propagator-gcp

.. image:: https://readthedocs.org/projects/google-cloud-opentelemetry/badge/?version=latest
    :target: https://google-cloud-opentelemetry.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

This library provides support for propagating trace context in the Google
Cloud ``X-Cloud-Trace-Context`` format.

Installation
------------

.. code:: bash

    pip install opentelemetry-propagator-gcp

Usage
-----

The ``CloudTraceOneWayPropagator`` reads the Google Cloud
``X-Cloud-Trace-Context`` format, but does not write the
``X-Cloud-Trace-Context`` header on outgoing requests. It is intended for use
with a CompositePropagator as below.

.. code-block:: python

    from opentelemetry.propagate import set_global_textmap
    from opentelemetry.propagators.composite import CompositePropagator
    from opentelemetry.propagators.cloud_trace_propagator import (
        CloudTraceOneWayPropagator,
    )
    set_global_textmap(
        CompositePropagator([
            CloudTraceOneWayPropagator(),
            propagate.get_global_textmap(),
        ]),
    )

The ``CloudTraceFormatPropagator`` reads and writes the
``X-Cloud-Trace-Context`` header formats. Note that when using this propagator,
the ``sampled`` bit is interpreted as the ``TRACE_TRUE`` flag, which may cause a
higher sampling rate than desired. See the `Trace documentation
<https://cloud.google.com/trace/docs/setup#force-trace>` for additional context.

.. code-block:: python

    from opentelemetry.propagate import set_global_textmap
    from opentelemetry.propagators.cloud_trace_propagator import (
        CloudTraceFormatPropagator,
    )

    # Set the X-Cloud-Trace-Context header
    set_global_textmap(CloudTraceFormatPropagator())
.. code-block:: python

    from opentelemetry.propagate import set_global_textmap
    from opentelemetry.propagators.cloud_trace_propagator import (
        CloudTraceFormatPropagator,
    )

    # Set the X-Cloud-Trace-Context header
    set_global_textmap(CloudTraceFormatPropagator())


References
----------

* `Cloud Trace <https://cloud.google.com/trace/>`_
* `OpenTelemetry Project <https://opentelemetry.io/>`_

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/tree/main/opentelemetry-propagator-gcp",
    "name": "opentelemetry-propagator-gcp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Google",
    "author_email": "opentelemetry-pypi@google.com",
    "download_url": "https://files.pythonhosted.org/packages/19/56/4088532047641df2fcd5ac809dde3eb64d48b144e72ea0d131dadbe7b66f/opentelemetry_propagator_gcp-1.7.0.tar.gz",
    "platform": "any",
    "description": "OpenTelemetry Google Cloud Propagator\n======================================\n\n.. image:: https://badge.fury.io/py/opentelemetry-propagator-gcp.svg\n    :target: https://badge.fury.io/py/opentelemetry-propagator-gcp\n\n.. image:: https://readthedocs.org/projects/google-cloud-opentelemetry/badge/?version=latest\n    :target: https://google-cloud-opentelemetry.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\nThis library provides support for propagating trace context in the Google\nCloud ``X-Cloud-Trace-Context`` format.\n\nInstallation\n------------\n\n.. code:: bash\n\n    pip install opentelemetry-propagator-gcp\n\nUsage\n-----\n\nThe ``CloudTraceOneWayPropagator`` reads the Google Cloud\n``X-Cloud-Trace-Context`` format, but does not write the\n``X-Cloud-Trace-Context`` header on outgoing requests. It is intended for use\nwith a CompositePropagator as below.\n\n.. code-block:: python\n\n    from opentelemetry.propagate import set_global_textmap\n    from opentelemetry.propagators.composite import CompositePropagator\n    from opentelemetry.propagators.cloud_trace_propagator import (\n        CloudTraceOneWayPropagator,\n    )\n    set_global_textmap(\n        CompositePropagator([\n            CloudTraceOneWayPropagator(),\n            propagate.get_global_textmap(),\n        ]),\n    )\n\nThe ``CloudTraceFormatPropagator`` reads and writes the\n``X-Cloud-Trace-Context`` header formats. Note that when using this propagator,\nthe ``sampled`` bit is interpreted as the ``TRACE_TRUE`` flag, which may cause a\nhigher sampling rate than desired. See the `Trace documentation\n<https://cloud.google.com/trace/docs/setup#force-trace>` for additional context.\n\n.. code-block:: python\n\n    from opentelemetry.propagate import set_global_textmap\n    from opentelemetry.propagators.cloud_trace_propagator import (\n        CloudTraceFormatPropagator,\n    )\n\n    # Set the X-Cloud-Trace-Context header\n    set_global_textmap(CloudTraceFormatPropagator())\n.. code-block:: python\n\n    from opentelemetry.propagate import set_global_textmap\n    from opentelemetry.propagators.cloud_trace_propagator import (\n        CloudTraceFormatPropagator,\n    )\n\n    # Set the X-Cloud-Trace-Context header\n    set_global_textmap(CloudTraceFormatPropagator())\n\n\nReferences\n----------\n\n* `Cloud Trace <https://cloud.google.com/trace/>`_\n* `OpenTelemetry Project <https://opentelemetry.io/>`_\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Google Cloud propagator for OpenTelemetry",
    "version": "1.7.0",
    "project_urls": {
        "Homepage": "https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/tree/main/opentelemetry-propagator-gcp"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56ca55be1c538deb9ed1111a61be0301838bc4d8f963cbddd0e5ec819a0c937e",
                "md5": "cff025f24c1c5a569c34feab7d213c4e",
                "sha256": "49e338b41c53b98f0d74402d103656271f17cabed15793b88387a0b43c4a3518"
            },
            "downloads": -1,
            "filename": "opentelemetry_propagator_gcp-1.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cff025f24c1c5a569c34feab7d213c4e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 9458,
            "upload_time": "2024-08-27T19:25:49",
            "upload_time_iso_8601": "2024-08-27T19:25:49.902547Z",
            "url": "https://files.pythonhosted.org/packages/56/ca/55be1c538deb9ed1111a61be0301838bc4d8f963cbddd0e5ec819a0c937e/opentelemetry_propagator_gcp-1.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "19564088532047641df2fcd5ac809dde3eb64d48b144e72ea0d131dadbe7b66f",
                "md5": "f776d4741616835508058f22b27b54bf",
                "sha256": "c4e5ffd4bce5f71702edbeefd3243e8ad10040a59b9d83c0246c603b578a4020"
            },
            "downloads": -1,
            "filename": "opentelemetry_propagator_gcp-1.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f776d4741616835508058f22b27b54bf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10435,
            "upload_time": "2024-08-27T19:25:54",
            "upload_time_iso_8601": "2024-08-27T19:25:54.749214Z",
            "url": "https://files.pythonhosted.org/packages/19/56/4088532047641df2fcd5ac809dde3eb64d48b144e72ea0d131dadbe7b66f/opentelemetry_propagator_gcp-1.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-27 19:25:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "GoogleCloudPlatform",
    "github_project": "opentelemetry-operations-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "opentelemetry-propagator-gcp"
}
        
Elapsed time: 0.28610s