Skip to main content
net6.0.NETStandard2.0

An implementation of trace span sender based on Hercules client. Also provides mapping from Hercules events back to spans.

Published
Dec 8, 2021
4y ago
Total Downloads
1.8M
1,775,552

Install

dotnet add package Vostok.Tracing.Hercules --version 0.1.7
ProductVersions
.NET
net6.0
.NET Standard
netstandard2.0

README

Vostok.Tracing.Hercules

Build & Test & Publish NuGet

An implementation of trace span sender based on Hercules client. Also provides mapping from Hercules events back to spans.

Here's how ISpan instances are mapped into Hercules events (according to schema):

  • TraceId (mandatory) ---> traceId tag of UUID type.

  • SpanId (mandatory) ---> spanId tag of UUID type.

  • ParentSpanId (optional) ---> parentSpanId tag of UUID type.

  • BeginTimestamp (mandatory) corresponds to 2 tags:

    • beginTimestampUtc — a long tag that contains the UTC timestamp in 100-ns ticks from Unix epoch.
    • beginTimestampUtcOffset — a long tag with offset from UTC expressed in 100-ns ticks.
  • EndTimestamp (optional) also corresponds to 2 tags, both of which can be absent for 'endless' spans:

    • endTimestampUtc — a long tag that contains the UTC timestamp in 100-ns ticks from Unix epoch.
    • endTimestampUtcOffset — a long tag with offset from UTC expressed in 100-ns ticks.
  • Annotations dictionary corresponds to a container with name annotations. This container contains a tag for each pair. Keys are translated as-is, and the values are handled according to following conventions:

    • If the value is a primitive scalar or a vector of primitive scalars natively supported by Hercules (such as int, long, guid, string, etc), it's mapped as-is.
    • Otherwise the value gets converted to string: either stringified directly (if it properly overrides ToString()) or serialized to JSON. No further container-like structure is allowed, all values end up being 'flat'.

Hercules event's built-in timestamp is chosen equal to EndTimestampUtc or BeginTimestampUtc if former is missing.

Unix epoch used as a reference point for timestamp is 1970-01-01 00:00:00.000Z.

Changes from Previous Version

No structural changes between v0.1.7-pre000019 and v0.1.7.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.