Giter Site home page Giter Site logo

johnbley / opentelemetry-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from open-telemetry/opentelemetry-swift

0.0 0.0 0.0 3.14 MB

OpenTelemetry API for Swift

Home Page: https://opentelemetry.io/docs/instrumentation/swift/

License: Apache License 2.0

Shell 0.08% Swift 99.63% Makefile 0.10% Jinja 0.19%

opentelemetry-swift's Introduction

OpenTelemetry Icon opentelemetry-swift

CI codecov

About

The repository contains the Swift OpenTelemetry client

Getting Started

This package includes several libraries. The OpenTelemetryApi library includes protocols and no-op implementations that comprise the OpenTelemetry API following the specification. The OpenTelemetrySdk library is the reference implementation of the API.

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

Adding the dependency

opentelemetry-swift is designed for Swift 5. To depend on the opentelemetry-swift package, you need to declare your dependency in your Package.swift:

.package(url: "https://github.com/open-telemetry/opentelemetry-swift", from: "1.0.0"),

and to your application/library target, add OpenTelemetryApi or OpenTelemetrySdkto your dependencies, e.g. like this:

.target(name: "ExampleTelemetryProducerApp", dependencies: ["OpenTelemetryApi"]),

or

.target(name: "ExampleApp", dependencies: ["OpenTelemetrySdk"]),

Documentation

Official documentation for the library can be found in the official opentelemetry documentation page, including:

Current status

API and SDK

Tracing and Baggage are considered stable

Logs are considered beta quality

Metrics is implemented using an outdated spec, is fully functional but will change in the future

Supported exporters and importers

Traces

  • Exporters: Stdout, Jaeger, Zipkin, Datadog and OpenTelemetry (OTLP) collector
  • Importers: OpenTracingShim

Metrics

  • Exporters: Prometheus, Datadog, and OpenTelemetry (OTLP) collector
  • Importers: SwiftMetricsShim

Logs

  • Exporters: OpenTelemetry (OTLP) collector

NOTE: OTLP exporters are supported both in GRPC and HTTP, only GRPC is production ready, HTTP is still experimental

Instrumentation libraries

  • URLSession
  • NetworkStatus
  • SDKResourceExtension
  • SignPostIntegration

Examples

The package includes some example projects with basic functionality:

  • Datadog Sample - Shows the Datadog exporter used with a Simple Exporter, showing how to configure for sending.
  • Logging Tracer - Simple api implementation of a Tracer that logs every api call
  • Network Tracer - Shows how to use the URLSessionInstrumentation instrumentation in your application
  • Simple Exporter - Shows the Jaeger an Stdout exporters in action using a MultiSpanExporter. Can be easily modified for other exporters
  • Prometheus Sample - Shows the Prometheus exporter reporting metrics to a Prometheus instance
  • OTLP Exporter - Shows the OTLP exporter reporting traces to Zipkin and metrics to a Prometheus via the otel-collector

Contributing

For an overview of how to contribute, see the contributing guide in CONTRIBUTING.md.

We are also available in the #otel-swift channel in the CNCF slack. Please join us there for further discussions.

opentelemetry-swift's People

Contributors

andraskadar avatar austinlparker avatar batuhansk avatar bennettsmith avatar bryce-b avatar chalin avatar crsantos avatar danielqsj avatar emanuelschmoczer avatar gjeltep avatar hunguyenaxon avatar itsniper avatar jhoongo avatar johnbley avatar jomisj avatar kevinearls avatar kkelvinlo avatar lunij avatar mattxw avatar mxiamxia avatar nachobonafonte avatar rayzhao1998 avatar sebastian-qm avatar seemk avatar sergeykanzhelev avatar sherlouk avatar trevor-dialpad avatar vj4iosdev avatar vvydier avatar yangjian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.