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.
To get started with instrumentation in Google Cloud, see `Generate traces and metrics with
Python <https://cloud.google.com/stackdriver/docs/instrumentation/setup/python>`_.
To learn more about instrumentation and observability, including opinionated recommendations
for Google Cloud Observability, visit `Instrumentation and observability
<https://cloud.google.com/stackdriver/docs/instrumentation/overview>`_.
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/be/b6/8c13c5d7f39134350239a60f306bf1f4c8bd0b597b02d3aff3eafd864f8f/opentelemetry_propagator_gcp-1.8.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\nTo get started with instrumentation in Google Cloud, see `Generate traces and metrics with\nPython <https://cloud.google.com/stackdriver/docs/instrumentation/setup/python>`_.\n\nTo learn more about instrumentation and observability, including opinionated recommendations\nfor Google Cloud Observability, visit `Instrumentation and observability\n<https://cloud.google.com/stackdriver/docs/instrumentation/overview>`_.\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.8.0",
"project_urls": {
"Homepage": "https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/tree/main/opentelemetry-propagator-gcp"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8a1b6a6d04d6abfc2fe0123ba3158c1d43e998de2d33a810259cd821c00d5954",
"md5": "47f116df95258273ba332358cff8271e",
"sha256": "291eae67ce070ad0c6ac78602b56665b96ec6d4dea333602dfc60c04e7120759"
},
"downloads": -1,
"filename": "opentelemetry_propagator_gcp-1.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "47f116df95258273ba332358cff8271e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 9606,
"upload_time": "2025-01-08T19:38:56",
"upload_time_iso_8601": "2025-01-08T19:38:56.862891Z",
"url": "https://files.pythonhosted.org/packages/8a/1b/6a6d04d6abfc2fe0123ba3158c1d43e998de2d33a810259cd821c00d5954/opentelemetry_propagator_gcp-1.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "beb68c13c5d7f39134350239a60f306bf1f4c8bd0b597b02d3aff3eafd864f8f",
"md5": "1a9f0e7c8a40037aa4fcd1789b1f6245",
"sha256": "82ebced7a504b95024447ccb5fa18fb11c1eafbeb49c2b917486bd756c76bac5"
},
"downloads": -1,
"filename": "opentelemetry_propagator_gcp-1.8.0.tar.gz",
"has_sig": false,
"md5_digest": "1a9f0e7c8a40037aa4fcd1789b1f6245",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 10610,
"upload_time": "2025-01-08T19:39:03",
"upload_time_iso_8601": "2025-01-08T19:39:03.795669Z",
"url": "https://files.pythonhosted.org/packages/be/b6/8c13c5d7f39134350239a60f306bf1f4c8bd0b597b02d3aff3eafd864f8f/opentelemetry_propagator_gcp-1.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-08 19:39:03",
"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"
}