Skip to content

Commit

Permalink
Merge pull request #237 from solarwinds/NH-70337
Browse files Browse the repository at this point in the history
Add Changelog
  • Loading branch information
raphael-theriault-swi authored Feb 7, 2024
2 parents c3ac1fe + 293b725 commit 8820403
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .yarn/versions/03fbd631.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
releases:
solarwinds-apm: minor
13 changes: 13 additions & 0 deletions packages/solarwinds-apm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# `solarwinds-apm` Changelog

## 14.0.0 (prerelease)

This is a breaking release and a completely new version built from scratch using OpenTelemetry.

- The library now requires the `@opentelemetry/api` package to be installed alongside it, with the version range `^1.3.0`.
- The public API surface of the library has been greatly reduced. The `@opentelemetry/api` package can instead be used for all custom instrumentation needs.
- The configuration file name has changed and some options have been renamed or altered. Check out [the configuration guide](./CONFIGURATION.md) for more details.
- The list of instrumented libraries has changed as the library now uses OpenTelemetry instrumentation. Custom instrumentations can now also be provided by the user. See [the updated list of bundled instrumentations](../instrumentations/COMPATIBILITY.md) for more details.
- ESM is now supported by default. The recommended way to load the library is now using the `--import` flag instead of the `--require` flag, even though the latter is still supported.
- The new library is written in TypeScript and will always provide up to date and accurate type declarations.
- The new library will support all LTS Node.js versions up to one year after their End of Life. Support for older versions will not be provided since they should not be used.
1 change: 1 addition & 0 deletions packages/solarwinds-apm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"files": [
"./src/",
"./dist/",
"./CHANGELOG.md",
"./CONFIGURATION.md"
],
"publishConfig": {
Expand Down
9 changes: 6 additions & 3 deletions packages/solarwinds-apm/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ export interface ExtendedSwConfiguration extends SwConfiguration {
metrics: Metrics

dev: z.infer<typeof schema>["dev"]

source?: string
}

const ENV_PREFIX = "SW_APM_"
Expand All @@ -192,6 +194,9 @@ export function readConfig():
const env = envObject()
const devEnv = envObject(ENV_PREFIX_DEV)

const path = filePath()
const file = path ? readConfigFile(path) : {}

const processFile = (file: object): ExtendedSwConfiguration => {
const devFile =
"dev" in file && typeof file.dev === "object" && file.dev !== null
Expand All @@ -212,6 +217,7 @@ export function readConfig():
oboeLogLevel: otelLevelToOboeLevel(raw.logLevel),
oboeLogType: otelLevelToOboeType(raw.logLevel),
otelLogLevel: getEnvWithoutDefaults().OTEL_LOG_LEVEL ?? raw.logLevel,
source: path,
}

if (config.collector?.includes("appoptics.com")) {
Expand All @@ -222,9 +228,6 @@ export function readConfig():
return config
}

const path = filePath()
const file = path ? readConfigFile(path) : {}

if (file instanceof Promise) return file.then(processFile)
else return processFile(file)
}
Expand Down
2 changes: 2 additions & 0 deletions packages/solarwinds-apm/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export async function init() {

diag.setLogger(new sdk.SwDiagLogger(), config.otelLogLevel)
const logger = diag.createComponentLogger({ namespace: "[sw/init]" })
logger.debug(`CWD is ${process.cwd()}`)
logger.debug("SolarWinds APM configuration", config)

if (!config.enabled) {
logger.info("Library disabled, application will not be instrumented")
Expand Down

0 comments on commit 8820403

Please sign in to comment.