-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add grafana example #290
Add grafana example #290
Conversation
docs/examples/grafana/README.md
Outdated
|
||
Add settings to the `build.sbt`: | ||
```scala | ||
libraryDependencies ++= Seq( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example uses Scala 3. Should we reference the Scala version in the settings too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also thinking about whether we should provide multiple examples:
- sbt. Scala 2
- sbt. Scala 3
- scala-cli. Scala 2
- scala-cli. Scala 3
The code will be nearly identical, so the benefit is questionable.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding showing the differences between Scala 2 and 3 the only thing coming to my mind for sbt is ThisBuild / scalaVersion
, maybe I'm missing something though. Assuming there's only this attribute changing I don't know if it's worth adding a dedicated scala 3 example just for that.
I never got to try scala-cli yet, so I can't really tell how different things should be there, so maybe it could be worth having a scala 3 example here, tell me what you think
@:choice(sbt) | ||
|
||
```shell | ||
$ sbt run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see an entry point in the example above, so will sbt run
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tried it on my example project, works fine 👌
On a second thought though I wonder if the scala-cli snippet makes a lot of sense here, it could maybe even be somewhat misleading as I chose grafana.scala
kind of as a placeholder name.
Should I change/remove it ?
Great example, thanks! I like dashboards being attached too. A few minor questions to discuss and we can move forward. |
df32811
to
13a01d5
Compare
docs/examples/grafana/README.md
Outdated
@:choice(scala-cli Scala 2) | ||
|
||
Add directives to the `grafana.scala`: | ||
```scala | ||
//> using lib "org.typelevel::otel4s-java:@VERSION@" // <1> | ||
//> using lib "io.opentelemetry:opentelemetry-exporter-otlp:@OPEN_TELEMETRY_VERSION@" // <2> | ||
//> using lib "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:@OPEN_TELEMETRY_VERSION@" // <3> | ||
//> using `java-opt` "-Dotel.java.global-autoconfigure.enabled=true" // <4> | ||
//> using `java-opt` "-Dotel.service.name=grafana-example" // <5> | ||
``` | ||
|
||
@:choice(scala-cli Scala 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@:choice(scala-cli Scala 2) | |
Add directives to the `grafana.scala`: | |
```scala | |
//> using lib "org.typelevel::otel4s-java:@VERSION@" // <1> | |
//> using lib "io.opentelemetry:opentelemetry-exporter-otlp:@OPEN_TELEMETRY_VERSION@" // <2> | |
//> using lib "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:@OPEN_TELEMETRY_VERSION@" // <3> | |
//> using `java-opt` "-Dotel.java.global-autoconfigure.enabled=true" // <4> | |
//> using `java-opt` "-Dotel.service.name=grafana-example" // <5> | |
``` | |
@:choice(scala-cli Scala 3) | |
@:choice(scala-cli) |
Let's keep only one scala-cli example.
|
||
Add directives to the `grafana.scala`: | ||
```scala | ||
//> using lib "org.typelevel::otel4s-java:@VERSION@" // <1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//> using lib "org.typelevel::otel4s-java:@VERSION@" // <1> | |
//> using scala 3.3.0 | |
//> using lib "org.typelevel::otel4s-java:@VERSION@" // <1> |
That way we can ensure users will have a correct Scala version and the example will compile
docs/examples/grafana/README.md
Outdated
|
||
@:choice(sbt Scala 3) | ||
|
||
Add settings to the `build.sbt`: | ||
```scala | ||
libraryDependencies ++= Seq( | ||
"org.typelevel" %% "otel4s-java" % "@VERSION@", // <1> | ||
"io.opentelemetry" % "opentelemetry-exporter-otlp" % "@OPEN_TELEMETRY_VERSION@" % Runtime, // <2> | ||
"io.opentelemetry" % "opentelemetry-sdk-extension-autoconfigure" % "@OPEN_TELEMETRY_VERSION@" % Runtime // <3> | ||
) | ||
run / fork := true | ||
javaOptions += "-Dotel.java.global-autoconfigure.enabled=true" // <4> | ||
javaOptions += "-Dotel.service.name=grafana-example" // <5> | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@:choice(sbt Scala 3) | |
Add settings to the `build.sbt`: | |
```scala | |
libraryDependencies ++= Seq( | |
"org.typelevel" %% "otel4s-java" % "@VERSION@", // <1> | |
"io.opentelemetry" % "opentelemetry-exporter-otlp" % "@OPEN_TELEMETRY_VERSION@" % Runtime, // <2> | |
"io.opentelemetry" % "opentelemetry-sdk-extension-autoconfigure" % "@OPEN_TELEMETRY_VERSION@" % Runtime // <3> | |
) | |
run / fork := true | |
javaOptions += "-Dotel.java.global-autoconfigure.enabled=true" // <4> | |
javaOptions += "-Dotel.service.name=grafana-example" // <5> | |
``` |
Let's keep only one sbt example
docs/examples/grafana/README.md
Outdated
|
||
@:select(build-tool) | ||
|
||
@:choice(sbt Scala 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@:choice(sbt Scala 2) | |
@:choice(sbt) |
I'm sorry for the delay. As you mentioned, I guess it's not worth making a separate example per Scala version since they are nearly identical. |
13a01d5
to
755600b
Compare
Should be good now 👍 |
I made a few changes to the PR keuhdall#1. We will have a minimal working example right on the documentation page, while we also reference your complete project too |
Grafana All-in-one, add more details: configuration notes, service configs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
Added Grafana example as described in #270
I was planning to also add Loki for a full Grafana-stack example with log correlations, but I think it is currently blocked by #202
Let me know if I should change anything the example ! 🙂