Îõ³h&0¢/V<      !"#$%&'()*+,-./0123456789:; Safe-Inferred"ÁÃÑöcore-telemetryÈOutput metrics to the terminal. This is mostly useful for debugging, but it can also be used as general output mechanism if your program is mostly concerned with gathering metrics and displaying them. Safe-Inferred"1 Safe-Inferred"ÁÃÑÜö©core-telemetry=Indicate which "dataset" spans and events will be posted intocore-telemetryôConfigure your application to send telemetry in the form of spans and traces to the Honeycomb observability service.  context <-  ... context' <-   [] context   context' ...  Safe-Inferred "ÁÃÑ×Üöv  core-telemetryºGet the MAC address of the first interface that's not the loopback device. If something goes weird then we return a valid but bogus address (in the locally administered addresses block).  core-telemetry‡Generate an identifier suitable for use in a trace context. Trace identifiers are 16 bytes. We incorporate the time to nanosecond precision, the host system's MAC address, and a random element. This is similar to a version 1 UUID, but we render the least significant bits of the time stamp ordered first so that visual distinctiveness is on the left. The MAC address in the lower 48 bits is notÊ reversed, leaving the most distinctiveness [the actual host as opposed to manufacturer OIN] hanging on the right hand edge of the identifier. The two bytes of supplied randomness are put in the middle. core-telemetryÌGenerate an identifier for a span. We only have 8 bytes to work with. We use the nanosecond prescision Time with the nibbles reversed, and then overwrite the last two bytes with the supplied random value. core-telemetry Render the  and  identifiers representing a span calling onward to another component in a distributed system. The W3C Trace Context recommendation specifies the HTTP header  traceparent2 with a version sequence (currently hard coded at 00…), the 16 byte trace identifier, the 8 byte span identifier, and a flag sequence (currently quite ignored), all formatted as follows: Å traceparent: 00-fd533dbf96ecdc610156482ae36c24f7-1d1e9dbf96ec4649-00 core-telemetryParse a  traceparent header into a  and ª, assuming it was a valid pair according to the W3C Trace Context recommendation. The expectation is that, if present in an HTTP request, these values would be passed to  å to allow the program to contribute spans to an existing trace started by another program or service. core-telemetryÎGet the identifier of the current trace, if you are within a trace started by   or  . core-telemetryÖGet the identifier of the current span, if you are currently within a span created by  .core-telemetryÛOverride the identifier of the current span, if you are currently within a span created by  ‹. This is an unsafe action, specifically and only for the situation where you need create a parent span for an asynchronous process whose unique identifier has already been nominated. In this scenario all child spans would already have been created with this span identifier as their parent, leaving you with the final task of creating a "root" span within the trace with that parent identifier.       Safe-Inferred "ÁÃÑ×Üö.Xcore-telemetryÎAdaptor class to take primitive values and send them as metrics. The underlying types are either strings, numbers, or boolean so any instance will need to externalize and then convert to one of these three.Ü(this class is what allows us to act pass in what look like polymorphic lists of metrics to  and  )core-telemetry–A telemetry value that can be sent over the wire. This is a wrapper around JSON values of type string, number, or boolean. You create these using the  method provided by a " instance and passing them to the  function in a span or   if noting an event.core-telemetryÊRecord the name of the service that this span and its children are a part of. A reasonable default is the name of the binary that's running, but frequently you'll want to put something a bit more nuanced or specific to your application. This is the overall name of the independent service, component, or program complimenting the label set when calling ‚, which by contrast descibes the name of the current phase, step, or even function name within the overall scope of the "service".This will end up as the  service.name parameter when exported.core-telemetry4Activate the telemetry subsystem for use within the  monad.Each exporter specified here will add setup and configuration to the context, including command-line options and environment variables needed as approrpiate:  context' <-  [ ] context ÆThis will allow you to then select the appropriate backend at runtime: $ !burgerservice --telemetry=console 8which will result in it spitting out metrics as it goes, Ï calories = 667.0 flavour = true meal_name = "hamburger" precise = 45.0  and so on.core-telemetry Begin a span.áYou need to call this from within the context of a trace, which is established either by calling  or + somewhere above this point in the program.¹You can nest spans as you make your way through your program, which means each span has a parent (except for the first one, which is the root span) In the context of a trace, allows an observability tool to reconstruct the sequence of events and to display them as a nested tree correspoding to your program flow.1The current time will be noted when entering the << this span encloses, and its duration recorded when the sub Programí exits. Start time, duration, the unique identifier of the span (generated for you), the identifier of the parent, and the unique identifier of the overall trace will be appended as metadata points and then sent to the telemetry channel.core-telemetry9Start a new trace. A random identifier will be generated.You must have a single "root span" immediately below starting a new trace.  program ::   () program = do  $ do ( "Service Request" $ do ... core-telemetry#Continue an existing trace using a  identifier and parent ¶ identifier sourced externally. This is the most common case. Internal services that play a part of a larger request will inherit a job identifier, sequence number, or other externally supplied unique code. Even an internet-facing web service might have a correlation ID provided by the outside load balancers.  program ::  • () program = do -- do something that gets the trace ID trace <- ... -- and something to get the parent span ID parent <- ...  ( trace) ( parent) $ do , "Internal processing" $ do ... core-telemetry&Create a new trace with the specified  identifier. Unlike  this does not set the parent Þ identifier, thereby marking this as a new trace and causing the first span enclosed within this trace to be considered the "root" span of the trace. This is unusual and should only expected to be used in concert with the ; override to create a root spans in asynchronous processes after9 all the child spans have already been composed and sent.>Most times, you don't need this. You're much better off using à to create a root span. However, life is not kind, and sometimes bad things happen to good abstractions. Maybe you're tracing your build system, which isn't obliging enough to be all contained in one Haskell process, but is a half-dozen steps shotgunned across several different processes. In situations like this, it's useful to be able to generate a  identifier and ¸ identifier, use that as the parent across several different process executions, hanging children spans off of this as you go, then manually send up the root span at the end of it all. × trace <- ... unique <- ... -- many child spans in other processes have used these as trace -- identifiers and parent span identifier. Now form the root span thereby -- finishing the trace.  trace $ do $ "Launch Missiles" $ do ! start  unique  [  ... ] core-telemetry%Add measurements to the current span.   [  "calories" (667 :: =) , % "precise" measurement ,  "meal_name" ("hamburger" :: >) ,  "flavour" ? ] The 3 function is a method provided by instances of the Œ typeclass which is mostly a wrapper around constructing key/value pairs suitable to be sent as measurements up to an observability service. core-telemetryíRecord telemetry about an event. Specify a label for the event and then whichever metrics you wish to record.—The emphasis of this package is to create traces and spans. There are, however, times when you just want to send telemetry about an event. You can use   to accomplish this.If you do call  ' within an enclosing span created with ¯ (the usual and expected use case) then this event will be "linked" to this span so that the observability tool can display it attached to the span in the in which it occured.   & "Make tea" [  "sugar" @ ] !core-telemetry,Override the start time of the current span.üUnder normal circumstances this shouldn't be necessary. The start and end of a span are recorded automatically when calling ð. Observabilty tools are designed to be used live; traces and spans should be created in real time in your code."core-telemetry8Reset the accumulated metadata metrics to the emtpy set.ÛThis isn't something you'd need in normal circumstances, as inheriting contextual metrics from surrounding code is usually what you want. But if you have a significant change of setting then clearing the attached metadata may be appropriate; after all, observability tools visualizing a trace will show you the context an event was encountered in.#core-telemetryæReset the program context so that the currently executing program is no longer within a trace or span.—This is specifically for the occasion where you have forked a new thread but have not yet received the event which would occasion starting a new trace.ŒThe current "service name" associated with this execution thread is preserved (usually this is set once per process at startup or once with À and having to reset it everytime you call this would be silly).$core-telemetry%core-telemetry&core-telemetry'core-telemetry9Strip the constructor off if the value is Just, and send A if Nothing.,core-telemetry%The usual warning about assuming the  ByteStringÄ is ASCII or UTF-8 applies here. Don't use this to send binary mush.-core-telemetry%The usual warning about assuming the  ByteStringÄ is ASCII or UTF-8 applies here. Don't use this to send binary mush. !"#! "# Safe-Inferred"ÁÃÑ/;core-telemetryOutput metrics to stdout" in the form of a raw JSON object.;; Safe-Inferred/,%  !"#; !"#$%&'()*    +,-./0123456789:;<=>?@ABCDEFGHIJKLMNIJOIJPQRSÔ-core-telemetry-0.2.6.1-INmoBjawYpF7uzmZNJGzPVCore.Telemetry.ObservabilityCore.Telemetry.ConsoleCore.Telemetry.GeneralCore.Telemetry.HoneycombCore.Telemetry.IdentifiersCore.Telemetry.StructuredCore.Program.Execute configureinitializeTelemetry executeWith usingTrace beginTrace encloseSpanProgramconsoleExporterNoneCore.Telemetry+core-program-0.6.0.1-DHbidhhfv0PAwaoAtiPEjBCore.Program.ContextSpanTraceExportergeneralExporterDatasethoneycombExporterhostMachineIdentitycreateIdentifierTracetoHexReversed64 toHexNormal64toHexReversed32 toHexNormal32createIdentifierSpancreateTraceParentHeaderparseTraceParentHeadergetIdentifierTracegetIdentifierSpansetIdentifierSpanLabel Telemetrymetric MetricValuesetServiceName usingTrace' telemetry sendEvent setStartTime clearMetrics clearTrace$fTelemetryUUID$fTelemetryDay$fTelemetryUTCTime$fTelemetryMaybe$fTelemetryJsonValue$fTelemetryBool$fTelemetryText$fTelemetryText0$fTelemetryByteString$fTelemetryByteString0 $fTelemetry() $fTelemetry[]$fTelemetryRope$fTelemetryScientific$fTelemetryDouble$fTelemetryFloat$fTelemetryInteger$fTelemetryWord64$fTelemetryWord32$fTelemetryInt64$fTelemetryInt32$fTelemetryInt$fShowMetricValuestructuredExporterghc-prim GHC.TypesInt'core-text-0.3.8.0-ci0vJby7Ar3lnbcwVgAPCCore.Text.RopeRopeTrueFalsebase Data.Foldablenull