8000 GitHub - lightstep/lightstep-tracer-objc: The Lightstep distributed tracing library for Objective-C and Swift
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

lightstep/lightstep-tracer-objc

Repository files navigation

lightstep-tracer-objc

This legacy instrumentation is no longer recommended. Please review documentation on setting up and configuring OpenTelemetry Swift.

Version License Platform

The LightStep distributed tracing library for Objective-C and Swift.

Installation (CocoaPods)

  1. Ensure you have CocoaPods installed (TL;DR: sudo gem install cocoapods)
  2. Create a Podfile in your Xcode project and add the following line:
pod 'lightstep', '~>3.2'
  1. Run pod install in your project directory. Open the newly created workspace file in Xcode.

Installation (Carthage)

Add following line to your Cartfile:

github "lightstep/lightstep-tracer-objc" ~> 3.0

Getting started

#import "LSTracer.h"
#import "OTGlobal.h"

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // Initialize the LightStep tracer implementation
    LSTracer* tracer = [[LSTracer alloc] initWithToken:@"{your_access_token}"];
    [OTGlobal initSharedTracer:tracer];

    // <Your normal initialization code here>

    return YES;
}

// Elsewhere:
- (void)someFunction:... {

    id<OTSpan> span = [[OTGlobal sharedTracer] startSpan:@"someFunction:"];

    ...

    [span finish];
}

About

The Lightstep distributed tracing library for Objective-C and Swift

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 10

0