Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
eb2c385
Take back ownership of the Plugin
guizmaii Apr 7, 2022
611d247
Merge pull request #1 from guizmaii/take_back_ownership
guizmaii Apr 7, 2022
f951b2f
Use the Unix Socket by default to connect to the agent (#4)
guizmaii Apr 7, 2022
535cadb
Update documentation (#5)
guizmaii Apr 7, 2022
8a10020
Fix release process (#6)
guizmaii Apr 7, 2022
e006a18
Fix release process (#7)
guizmaii Apr 7, 2022
a5d305f
Fix release process (#8)
guizmaii Apr 7, 2022
223f94c
Fix release process (#9)
guizmaii Apr 7, 2022
8b67a6b
Publish to Maven Central instead of Github Packages (which doesn't wo…
guizmaii Apr 7, 2022
aca7861
Fix build.sbt
guizmaii Apr 7, 2022
c895c22
Fix versioning
guizmaii Apr 7, 2022
799a8dd
Fix versioning
guizmaii Apr 7, 2022
fe2fd8d
Fix versioning
guizmaii Apr 7, 2022
d0fb07a
Try( Fix publishing )
guizmaii Apr 7, 2022
8b0e0bf
Update README
guizmaii Apr 7, 2022
add0831
Fix package name. Migrate from `com.colisweb.sbt` to `com.guizmaii.sb…
guizmaii Apr 13, 2022
ad0d3f2
Fix: Do not set the `-Ddd.trace.global.tags` if the `globalTags` is e…
guizmaii Apr 21, 2022
ac93cc1
Update doc
guizmaii May 3, 2022
6cf0a3d
Update default Datadog Agent version to the latest version (#14)
guizmaii May 4, 2022
ebeff73
[CI] Fix scala-steward config (#15)
guizmaii May 4, 2022
ce0cff2
Update sbt-updates to 0.6.2 (#16)
github-actions[bot] May 5, 2022
1b36d14
Update sbt-tpolecat to 0.2.3 (#17)
github-actions[bot] May 5, 2022
76e9da8
Update scalafmt-core to 3.0.8 (#19)
github-actions[bot] May 5, 2022
b5c5464
Update scalafmt-core to 3.5.4 (#24)
github-actions[bot] May 23, 2022
e7579bd
Update sbt-tpolecat to 0.3.1 (#20)
github-actions[bot] May 23, 2022
dcb5c7b
Bump release-drafter/release-drafter from 5.19.0 to 5.20.0 (#23)
dependabot[bot] May 23, 2022
50dd4da
Update scalafmt-core to 3.5.5 (#25)
github-actions[bot] May 25, 2022
833dce6
Update scalafmt-core to 3.5.7 (#26)
github-actions[bot] May 30, 2022
1f60c46
Update sbt-updates to 0.6.3 (#27)
github-actions[bot] May 31, 2022
82a5848
Update scalafmt-core to 3.5.8 (#28)
github-actions[bot] Jun 3, 2022
0e48683
Update sbt-tpolecat to 0.3.3 (#29)
github-actions[bot] Jun 7, 2022
e885893
Update scala-library to 2.12.16 (#30)
github-actions[bot] Jun 13, 2022
96539f3
Update sbt to 1.7.0 (#31)
github-actions[bot] Jul 11, 2022
289eb0a
Update sbt to 1.7.1 (#32)
github-actions[bot] Jul 13, 2022
198bfd8
Update sbt-tpolecat to 0.4.0 (#33)
github-actions[bot] Jul 18, 2022
1a5dbff
Update sbt-tpolecat to 0.4.1 (#34)
github-actions[bot] Jul 22, 2022
ed53a99
Update sbt-native-packager to 1.9.10 (#35)
github-actions[bot] Aug 9, 2022
3704de6
Remove useless "Datadog debug mode disabled" log (#36)
guizmaii Aug 10, 2022
2ebeb17
Add `datadogApmEnabled` setting
guizmaii Aug 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
59 changes: 59 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'

version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: minor

categories:
- title: 'Features'
label: 'enhancement'
- title: 'Bug Fixes'
label: 'bug'

exclude-labels:
- 'skip'

autolabeler:
- label: 'bug'
title:
- '/.*\[fix\].*/'
- label: 'patch'
title:
- '/.*\[fix\].*/'
- label: 'enhancement'
title:
- '/.*\[feat\].*/'
- label: 'minor'
title:
- '/.*\[feat\].*/'
- label: 'skip'
title:
- '/.*\[skip\].*/'
- label: 'major'
title:
- '/.*\[breaking\].*/'

replacers:
- search: '/\[feat\]/g'
replace: ''
- search: '/\[fix\]/g'
replace: ''
- search: '/\[skip\]/g'
replace: ''
- search: '/\[breaking\]/g'
replace: ''

template: |
# What's Changed

$CHANGES

39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
pull_request:
types: [ opened, reopened, synchronize ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
check-latest: true
- name: Run scalafix and scalafmt
run: sbt 'scalafmtSbtCheck; scalafmtCheckAll;'

ci:
runs-on: ubuntu-latest
steps:
- run: env
shell: bash
- uses: actions/checkout@v3
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
check-latest: true

- name: Compile code
shell: bash
run: sbt 'clean;Test/compile'
17 changes: 17 additions & 0 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release Drafter

on:
push:
branches:
- main

pull_request:
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5.20.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

# Triggered when a draft released is "published" (not a draft anymore)
on:
release:
types: [ published ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
publish:
runs-on: ubuntu-latest
steps:
- run: env
shell: bash
- uses: actions/checkout@v3
- uses: coursier/cache-action@v6
- uses: olafurpg/setup-gpg@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
check-latest: true

- name: Publish package
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
16 changes: 16 additions & 0 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Launch Scala Steward

# This workflow will launch everyday at 00:00
on:
schedule:
- cron: '0 0 * * 1-5'

jobs:
scala-steward:
runs-on: ubuntu-latest
name: Launch Scala Steward
steps:
- name: Launch Scala Steward
uses: scala-steward-org/scala-steward-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
17 changes: 0 additions & 17 deletions .gitlab-ci.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

35 changes: 32 additions & 3 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
version = 3.0.0
style = defaultWithAlign
maxColumn = 120
version = "3.5.8"
runner.dialect = scala212 # https://scalameta.org/scalafmt/docs/configuration.html#scala-2-with--xsource3
maxColumn = 140
align.preset = most
continuationIndent.defnSite = 2
assumeStandardLibraryStripMargin = true
docstrings.style = Asterisk
lineEndings = preserve
includeCurlyBraceInSelectChains = true
danglingParentheses.preset = true
optIn.annotationNewlines = true
newlines.alwaysBeforeMultilineDef = false
newlines.implicitParamListModifierPrefer = before
trailingCommas = multiple
docstrings.wrap = no

rewrite.rules = [RedundantBraces, SortModifiers]

rewrite.sortModifiers.order = [
"implicit", "override", "private", "protected", "final", "sealed", "abstract", "lazy"
]
rewrite.redundantBraces.generalExpressions = false
rewrite.redundantBraces.stringInterpolation = true
rewriteTokens = {
"⇒": "=>"
"→": "->"
"←": "<-"
}

project.excludePaths = [
"glob:**/modules/caliban-client/src/main/scala/io/conduktor/devtools/api/client/generated/**.scala"
]
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

70 changes: 35 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# sbt-datadog

[ ![Download](https://api.bintray.com/packages/colisweb/sbt-plugins/sbt-datadog/images/download.svg) ](https://bintray.com/colisweb/sbt-plugins/sbt-datadog/_latestVersion)
## Disclaimer

⚠️ **This is a fork of the original (that I also wrote a long time ago) [Colisweb/sbt-datadog](https://github.com/Colisweb/sbt-datadog)** ⚠️

# Documentation

This project is highly inspired by the fantastic [sbt-newrelic](https://github.com/gilt/sbt-newrelic) project.

Expand All @@ -20,8 +24,7 @@ Installation
Add the following to your `project/plugins.sbt` file:

```scala

addSbtPlugin("com.colisweb" % "sbt-datadog" % "2.1.0")
addSbtPlugin("com.guizmaii" % "sbt-datadog" % "4.3.0")
```

To enable the Datadog APM for your project, add the `DatadogAPM` auto-plugin to your project.
Expand All @@ -38,75 +41,72 @@ Configuration
To use a specific Datadog Java APM Agent version, add the following to your `build.sbt` file:

```scala
datadogApmVersion := "0.74.1"
datadogApmVersion := "0.98.1"
```

#### `datadogServiceName`
#### `datadogApmEnabled`

By default, the agent will use the sbt project `name` value as `service.name`.
You can easily disable the Datadog APM by settings this setting to `false`.
Note that if you have the `DD_TRACE_ENABLED` environment variable set, it'll take precedence over this setting.
See https://docs.datadoghq.com/tracing/trace_collection/library_config/java/

To use another value, add the following to your `build.sbt` file:
Default value: `true`

```scala
datadogServiceName := "another name"
```

You can use your **host** (where you code run) environment variables in the value:

```scala
datadogServiceName := "another name ${MY_HOST_ENV_VAR}"
datadogApmEnabled := true
```

#### `datadogAgentHost`
#### `datadogServiceName`

By default, the agent `agent.host` value is `localhost`.
By default, the agent will use the sbt project `name` value as `service.name`.

To use another value, add the following to your `build.sbt` file:

```scala
datadogAgentHost := "127.0.0.1"
datadogServiceName := "another name"
```

You can use your **host** (where you code run) environment variables in the value:

```scala
datadogAgentHost := "${MY_DD_HOST_IP}"
datadogServiceName := "another name ${MY_HOST_ENV_VAR}"
```

#### `datadogAgentPort`
#### `datadogAgentTraceUrl`

By default, the agent `agent.port` value is `"8126"`.
Defines how the APM will communicate with the Datadog Agent.

To use another value, add the following to your `build.sbt` file:
Two ways are available:
- via Unix Socket (default)
- via HTTP

```scala
datadogAgentPort := "9999"
```
By default, the agent `trace.agent.url` value is `/var/run/datadog/apm.socket`.

You can use your **host** (where you code run) environment variables in the value:
To use a different Unix Socket, add the following to your `build.sbt` file:

```scala
datadogAgentPort := "${MY_DD_PORT}"
datadogAgentTraceUrl := TraceAgentUnixSocketUrl(socket = "/my/directory/my.socket")
```

#### `datadogEnableNetty`
To use the default HTTP URL (`locahost:8126`), add the following to your `build.sbt` file:

Netty Http Server and Client Instrumentation. Default value is `false`.
```scala
datadogAgentTraceUrl := TraceAgentUrl.defaultHttpUrl
```

To use another value, add the following to your `build.sbt` file:
To use a custom HTTP URL, add the following to your `build.sbt` file:

```scala
datadogEnableNetty := true
datadogAgentTraceUrl := TraceAgentHttpUrl(host = "my.host.address.com", port = "8888")
```

#### `datadogEnableAkkaHttp`

Akka-Http Server and Lagom Framework Instrumentation. Default value is `false`.

To use another value, add the following to your `build.sbt` file:
You can use your **host** (where you code run) environment variables in the values:

```scala
datadogEnableAkkaHttp := true
datadogAgentTraceUrl := TraceAgentHttpUrl(host = "${MY_DD_HOST_IP}", port = "8888")
// Or
datadogAgentTraceUrl := TraceAgentUnixSocketUrl(socket = "${MY_DD_UNIX_SOCKET}")
```

#### `datadogEnableDebug`
Expand Down
Loading