diff --git a/.github/config/.rumdl.toml b/.github/config/.rumdl.toml new file mode 100644 index 0000000000..4e809f4901 --- /dev/null +++ b/.github/config/.rumdl.toml @@ -0,0 +1,11 @@ +[global] +disable = ["line-length", "ul-style", "no-inline-html", "fenced-code-language"] + +[no-duplicate-heading] +siblings-only = true + +[no-trailing-punctuation] +punctuation = ".,;:" + +[ol-prefix] +style = "ordered" diff --git a/.github/config/flint.toml b/.github/config/flint.toml new file mode 100644 index 0000000000..51434a7ffa --- /dev/null +++ b/.github/config/flint.toml @@ -0,0 +1,5 @@ +[settings] +setup_migration_version = 2 + +[checks.lychee] +check_all_local = true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97d0871752..84b52d6533 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,23 +68,19 @@ jobs: env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - # this is not a required check to avoid blocking pull requests if external links break - link-check: - uses: ./.github/workflows/reusable-link-check.yml - - markdown-lint-check: - uses: ./.github/workflows/reusable-markdown-lint.yml + lint: + uses: ./.github/workflows/reusable-lint-check.yml required-status-check: needs: - build - test-declarative-configuration-run - - markdown-lint-check + - lint runs-on: ubuntu-latest if: always() steps: - if: > needs.build.result != 'success' || needs.test-declarative-configuration-run.result != 'success' || - needs.markdown-lint-check.result != 'success' - run: exit 1 \ No newline at end of file + needs.lint.result != 'success' + run: exit 1 diff --git a/.github/workflows/reusable-link-check.yml b/.github/workflows/reusable-lint-check.yml similarity index 65% rename from .github/workflows/reusable-link-check.yml rename to .github/workflows/reusable-lint-check.yml index 8ea87549c3..98158887dc 100644 --- a/.github/workflows/reusable-link-check.yml +++ b/.github/workflows/reusable-lint-check.yml @@ -1,4 +1,4 @@ -name: Reusable - Link check +name: Reusable - Lint check on: workflow_call: @@ -7,7 +7,7 @@ permissions: contents: read jobs: - link-check: + lint-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -16,16 +16,18 @@ jobs: - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1 - - name: Link check for pull requests + - name: Lint for pull requests if: github.event_name == 'pull_request' env: GITHUB_TOKEN: ${{ github.token }} - GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_BASE_REF: ${{ github.base_ref }} + GITHUB_HEAD_REF: ${{ github.head_ref }} PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} - run: mise run lint:links + run: mise run lint - - name: Link check for pushes and scheduled workflows + - name: Lint for pushes and workflow dispatches if: github.event_name != 'pull_request' env: GITHUB_TOKEN: ${{ github.token }} - run: mise run lint:links --full + run: mise run lint diff --git a/.github/workflows/reusable-markdown-lint.yml b/.github/workflows/reusable-markdown-lint.yml deleted file mode 100644 index 5b0dec6dbe..0000000000 --- a/.github/workflows/reusable-markdown-lint.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Reusable - Markdown lint check - -on: - workflow_call: - -permissions: - contents: read - -jobs: - markdown-lint-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1 - - - name: Run markdownlint - run: | - if ! mise run lint:markdown; then - echo "markdownlint failed. To auto-fix many issues locally, run:" - echo " mise run lint:markdown --fix" - exit 1 - fi diff --git a/.markdownlint.yaml b/.markdownlint.yaml deleted file mode 100644 index fcc8d4d0a5..0000000000 --- a/.markdownlint.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md -# and https://github.com/DavidAnson/markdownlint-cli2 - -ul-style: false -line-length: false -no-duplicate-heading: - siblings_only: true -ol-prefix: - style: ordered -no-inline-html: false -fenced-code-language: false -no-trailing-punctuation: - punctuation: ".,;:" # allowing exclamation points and question marks at end of sentences diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 368ece2788..48a051f025 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,14 +17,14 @@ To build the project, run: ./gradlew assemble ``` -## Markdown linting +## Linting -This repository uses [markdownlint](https://github.com/DavidAnson/markdownlint) via `markdownlint-cli2` managed by [mise](https://github.com/jdx/mise). +This repository uses [flint](https://github.com/grafana/flint) managed by [mise](https://github.com/jdx/mise) to run the configured lint checks, including Markdown and link validation. -To check all Markdown files: +To run all lint checks: ```bash -mise run lint:markdown +mise run lint ``` (note: Windows users may need to run `mise install` first) @@ -32,7 +32,7 @@ mise run lint:markdown To automatically fix fixable issues: ```bash -mise run lint:markdown --fix +mise run lint:fix ``` ## Style guide diff --git a/README.md b/README.md index a86392b4a2..64249264b9 100644 --- a/README.md +++ b/README.md @@ -23,73 +23,73 @@ To build the all of examples, run: - [Using the SDK AutoConfiguration module](autoconfigure) - This module contains a fully functional example of using the autoconfigure - SDK extension module to configure the SDK using only environment - variables (or system properties). + SDK extension module to configure the SDK using only environment + variables (or system properties). - Note: the `opentelemetry-sdk-extension-autoconfigure` module is still - experimental at this time. + experimental at this time. - [Manual instrumentation of HTTP](http) - This module provides an example of writing manual instrumentation for - HTTP, both client and server. + HTTP, both client and server. - Note: More production-ready instrumentation for HTTP is provided as part - of the [OpenTelemetry Java Instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation) - project. + of the [OpenTelemetry Java Instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation) + project. - [Manual span creation and baggage propagation](manual-tracing) - This module provides an example of manually creating spans using the - OpenTelemetry API with the ExtendedTracer. + OpenTelemetry API with the ExtendedTracer. - Additionally, it demonstrates how to use the OpenTelemetry API to - propagate baggage items. + propagate baggage items. - [Configuring the Jaeger Exporter](jaeger) - This module contains a fully functional example of configuring the - OpenTelemetry SDK to use a Jaeger exporter and send spans to it - using the OpenTelemetry API. + OpenTelemetry SDK to use a Jaeger exporter and send spans to it + using the OpenTelemetry API. - Note: This example requires Docker to be installed. - [Using the OpenTelemetry Java Agent](javaagent) - This module demonstrates using the OpenTelemetry Java Agent with a simple - Spring Boot application. Traces, metrics, and logs are exported to a - collector via OTLP. + Spring Boot application. Traces, metrics, and logs are exported to a + collector via OTLP. - [Spring native image telemetry with OpenTelemetry Spring Starter](spring-native) - This module demonstrates using the OpenTelemetry Spring Boot starter with a - GraalVM native image. Traces and metrics are exported to a collector via OTLP. + GraalVM native image. Traces and metrics are exported to a collector via OTLP. - [Configuring Log Appenders](log-appender) - This module demonstrates how to configure the Log4j and Logback appenders to - bridge logs into the OpenTelemetry Log SDK. + bridge logs into the OpenTelemetry Log SDK. - [Configuring the Logging Exporters](logging) - This module contains a fully functional example of configuring the - OpenTelemetry SDK to use a logging exporter. + OpenTelemetry SDK to use a logging exporter. - [Exporting application logs using JSON logging in Kubernetes](logging-k8s-stdout-otlp-json) - This module demonstrates how to export application logs using JSON logging - in Kubernetes. + in Kubernetes. - [Using the OpenTelemetry metrics API](metrics) - This module contains examples of using the OpenTelemetry metrics APIs. - [Using OpenTelemetry Micrometer shim](micrometer-shim) - This module contains an example of a typical Micrometer setup (Spring Boot - with Spring Boot Actuator) configured to bridge metrics to OpenTelemetry - with the Micrometer shim. + with Spring Boot Actuator) configured to bridge metrics to OpenTelemetry + with the Micrometer shim. - Note: The Micrometer shim is still experimental at this time. - [Setting up OTLP exporters](otlp) - OTLP is the OpenTelemetry Protocol. This module demonstrates how to - configure the OTLP exporters and send data to the OpenTelemetry Collector - using them. + configure the OTLP exporters and send data to the OpenTelemetry Collector + using them. - Note: This example requires Docker to be installed. - [Setting up the Prometheus exporter](prometheus) - This module shows how to configure the OpenTelemetry SDK to expose an - endpoint that can be scraped by Prometheus. + endpoint that can be scraped by Prometheus. - Note: The Prometheus metric reader is still experimental at this time. - [Manually Configuring the SDK](sdk-usage) - This module shows some concrete examples of manually configuring the - OpenTelemetry SDK for tracing. + OpenTelemetry SDK for tracing. - [Telemetry Testing](telemetry-testing) - This module demonstrates how to test OpenTelemetry instrumentation with - MockServer. + MockServer. - [Setting up the Zipkin exporter](zipkin) - This module contains a fully functional example of configuring the - OpenTelemetry SDK to use a Zipkin exporter and send spans to a - Zipkin backend using the OpenTelemetry API. + OpenTelemetry SDK to use a Zipkin exporter and send spans to a + Zipkin backend using the OpenTelemetry API. - Note: This example requires Docker to be installed. - [Declarative Configuration with the OpenTelemetry Java Agent](javaagent-declarative-configuration) - This module demonstrates how to use declarative configuration with the - OpenTelemetry Java Agent to configure tracing behavior, including - excluding specific endpoints from tracing. + OpenTelemetry Java Agent to configure tracing behavior, including + excluding specific endpoints from tracing. - Note: This example requires Java 17 or higher. - [Declarative Configuration with the OpenTelemetry Spring Boot Starter](spring-declarative-configuration) - This module demonstrates how to use declarative configuration with the diff --git a/mise.toml b/mise.toml index 0f958fe47e..845a792307 100644 --- a/mise.toml +++ b/mise.toml @@ -1,9 +1,12 @@ [tools] -lychee = "0.24.2" -k3d = "5.8.3" "go:github.com/grafana/oats" = "0.6.1" +k3d = "5.8.3" kubectl = "1.36.0" -markdownlint-cli2 = "0.22.1" + +# Linters +"aqua:grafana/flint" = "0.22.2" +lychee = "0.24.2" +rumdl = "0.1.91" [settings] # Only install tools explicitly defined in the [tools] section above @@ -16,7 +19,13 @@ windows_default_file_shell_args = "bash" unix_default_file_shell_args = "bash" use_file_shell_for_executable_tasks = true -# Pick the tasks you need from flint (https://github.com/grafana/flint) -[tasks."lint:links"] -description = "Check for broken links in changed files + all local links" -file = "https://raw.githubusercontent.com/grafana/flint/8b7082196051b576d0b8dde43e26d620e7c277b3/tasks/lint/links.sh" # v0.22.2 +[env] +FLINT_CONFIG_DIR = ".github/config" + +[tasks.lint] +description = "Run all lints" +run = "flint run" + +[tasks."lint:fix"] +description = "Auto-fix lint issues" +run = "flint run --fix" diff --git a/spring-declarative-configuration/README.md b/spring-declarative-configuration/README.md index b67c5b705f..1d0f7469c7 100644 --- a/spring-declarative-configuration/README.md +++ b/spring-declarative-configuration/README.md @@ -230,7 +230,7 @@ If the behavior is not what you expect, here are a few things to check: - **Health checks are still traced** - Verify the `rules` section under `otel.tracer_provider.sampler.rule_based_routing` in - `application.yaml` + `application.yaml` - Ensure the `pattern` matches your actual actuator paths (e.g., `/actuator.*`) - Confirm that `span_kind` is set to `SERVER` (or another correct span kind for your traffic) @@ -243,7 +243,7 @@ If the behavior is not what you expect, here are a few things to check: - Make sure you are modifying the correct `application.yaml` for the active Spring profile - Verify that all configuration keys are indented correctly under the `otel:` root - Double-check that any placeholders use `:` for defaults (e.g., - `${OTEL_EXPORTER_OTLP_ENDPOINT:http://localhost:4318}`) + `${OTEL_EXPORTER_OTLP_ENDPOINT:http://localhost:4318}`) If issues persist, compare your configuration to: