opsb

opsb

We’ve just started using OpenTelemetry — OpenTelemetry API v1.0.0-rc.3.2 to integrate our APM with Datadog. According to the Open Telemetry specification

  • The attribute value, which is either:
    • A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer.
    • An array of primitive type values. The array MUST be homogeneous, i.e. it MUST NOT contain values of different types. For protocols that do not natively support array values such values SHOULD be represented as JSON strings. There’s also Span attributes: array of primitives · Issue #111 · open-telemetry/opentelemetry-erlang · GitHub which seems to imply that opentelemetry-erlang supports arrays of primitives in span attributes. However when I try to add span attributes with an array
OpenTelemetry.Span.start_span(span_ctx, [{"key1", ["one", "two"]}])

in the otel collector logs I see that attribute come through as EMPTY. Is it currently possible to use arrays or is there still some work to do?

@tristan I saw you mention that you were scanning for Open Telemetry questions so I hope you don’t mind me tagging you here.

Showing Posts 1 to 7

tristan

tristan

Rebar3 Core Team

Hey, yea, @'ing me is fine :). Have you checked to make sure it isn’t being dropped on accident by the Erlang/Elixir code? Like by using the stdout trace exporter? If its there then it could be the protobuf conversion (we may even need to update the protobufs used in the exporter). I’ll have to look later, just wanted to throw some stuff out there in case you had time to investigate more before I do later today.

opsb

opsb OP

Hey, I took another look. With the following code

OpenTelemetry.Span.set_attribute(span_ctx, "list_test", [1, 2])

the output I see in the otel-collector logs is

otel-collector_1 | -> list_test: EMPTY(<Unknown OpenTelemetry attribute value type "EMPTY">)

I’ve got the following versions in mix.exs

{:opentelemetry, "~> 1.0.0-rc.3"},
{:opentelemetry_api, "~> 1.0.0-rc.3.2"},
{:opentelemetry_exporter, "~> 1.0.0-rc.3"},

Should also note that we’re using http for the exporter protocol.

tristan

tristan

Rebar3 Core Team

Hm, I think I see a bug in the encoding of arrays that could possibly be the cause – I think the proto, or at least the latest proto, requires the Erlang term before encoding to be {array_value, [{value, {int_value, 1}}, ...]} but we are passing {array_value, [{value, 1}, ...]}. Will need to setup a test to make sure the change works.

opsb

opsb OP

That sounds promising, many thanks for taking a look.

tristan

tristan

Rebar3 Core Team

I did a quick test against the collector exporting to zipkin and this patch seems to work exporter: update trace protos to v0.11.0 by tsloughter · Pull Request #314 · open-telemetry/opentelemetry-erlang · GitHub

opsb

opsb OP

Many thanks for taking a look! I did try and run my project with your patched version but I’m not entirely sure how to reference it. I used

{:opentelemetry, git: "https://github.com/tsloughter/opentelemetry-erlang", ref: "trace-protos-0.11.0", override: true},

but I got this error

* opentelemetry (https://github.com/tsloughter/opentelemetry-erlang)
  could not find an app file at "_build/dev/lib/opentelemetry/ebin/opentelemetry.app". Another app file was found in the same directory "_build/dev/lib/opentelemetry/ebin/otel_elixir_tests.app", try changing the dependency name to :otel_elixir_tests

If you know how get your branch running against an app let me know and I’ll give it a test.

tristan

tristan

Rebar3 Core Team

Since it is in a subdirectory you need to include the sparse option:

{:opentelemetry_exporter, github: “open-telemetry/opentelemetry-erlang”, sparse: “apps/opentelemetry_exporter”, override: true},

https://github.com/open-telemetry/opentelemetry-erlang#git-dependencies

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews