![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
opencensus-ext-stackdriver
Advanced tools
|pypi|
.. |pypi| image:: https://badge.fury.io/py/opencensus-ext-stackdriver.svg :target: https://pypi.org/project/opencensus-ext-stackdriver/
::
pip install opencensus-ext-stackdriver
Trace
This example shows how to report the traces to Stackdriver Trace:
.. code:: python
from opencensus.ext.stackdriver import trace_exporter as stackdriver_exporter
from opencensus.trace import tracer as tracer_module
exporter = stackdriver_exporter.StackdriverExporter(
project_id='your_cloud_project')
tracer = tracer_module.Tracer(exporter=exporter)
::
pip install google-cloud-trace<1.0.0
pipenv install google-cloud-trace<1.0.0
By default, traces are exported asynchronously, to reduce latency during
your code's execution. If you would like to export data on the main thread
use the synchronous transporter:
.. code:: python
from opencensus.common.transports.sync import SyncTransport
from opencensus.ext.stackdriver import trace_exporter as stackdriver_exporter
from opencensus.trace import tracer as tracer_module
exporter = stackdriver_exporter.StackdriverExporter(
project_id='your_cloud_project', transport=SyncTransport)
tracer = tracer_module.Tracer(exporter=exporter)
Stats
The OpenCensus Stackdriver Stats Exporter allows users to export metrics to Stackdriver Monitoring. The API of this project is still evolving. The use of vendoring or a dependency management tool is recommended.
.. _Stackdriver: https://app.google.stackdriver.com/metrics-explorer
Stackdriver Exporter Usage
Stackdriver Import
************************
.. code:: python
from opencensus.ext.stackdriver import stats_exporter as stackdriver
from opencensus.stats import stats as stats_module
Stackdriver Prerequisites
**************************
- OpenCensus Python libraries require Python 2.7 or later.
- Google Cloud Platform account and project.
- Google Stackdriver Monitoring enabled on your project (Need help? `Click here`_).
.. _Click here: https://opencensus.io/codelabs/stackdriver
Register the Stackdriver exporter
**********************************
.. code:: python
stats = stats_module.stats
view_manager = stats.view_manager
exporter = stackdriver.new_stats_exporter(stackdriver.Options(project_id="<id_value>"))
view_manager.register_exporter(exporter)
...
Stackdriver Code Reference
******************************
In the *examples* folder, you can find all the necessary steps to get the exporter, register a view, put tags on the measure, and see the values against the Stackdriver monitoring tool once you have defined the *project_id*.
For further details for the Stackdriver implementation, see the folder *stackdriver/stats_exporter/*.
+---------------------------------------------------------------------------------+-------------------------------------+
| Path & File | Short Description |
+=================================================================================+=====================================+
| contrib/opencensus-ext-stackdriver/examples/ | End to end example |
+---------------------------------------------------------------------------------+-------------------------------------+
| contrib/opencensus-ext-stackdriver/opencensus/ext/stackdriver/stats_exporter/ | Stats implementation for Stackdriver|
+---------------------------------------------------------------------------------+-------------------------------------+
References
----------
* `OpenCensus Project <https://opencensus.io/>`_
FAQs
OpenCensus Stackdriver Trace Exporter
We found that opencensus-ext-stackdriver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.