Using Polaris

Using Telemetry Tools

师成师成· 更新于 2026-09-29· 阅读 3 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

Getting Started with Apache Polaris, Prometheus and Jaeger

This example requires jq to be installed on your machine.

  1. Build the Polaris image if it’s not already present locally:

    ./gradlew \
      :polaris-server:assemble \
      :polaris-server:quarkusAppPartsBuild --rerun \
      -Dquarkus.container-image.build=true
  2. Start the docker compose group by running the following command from the root of the repository:

    docker compose -f getting-started/telemetry/docker-compose.yml up
  3. To access Polaris from the host machine, first request an access token:

    export POLARIS_TOKEN=$(curl -s http://localhost:8181/api/catalog/v1/oauth/tokens \
       --user root:s3cr3t \
       -d 'grant_type=client_credentials' \
       -d 'scope=PRINCIPAL_ROLE:ALL' | jq -r .access_token)
  4. Then, use the access token in the Authorization header when accessing Polaris; you can also test the X-Request-ID header; you should see it in all logs and traces:

    curl -v 'http://localhost:8181/api/management/v1/principal-roles' \
      -H "Authorization: Bearer $POLARIS_TOKEN" \
      -H "X-Request-ID: 1234"
    curl -v 'http://localhost:8181/api/catalog/v1/config?warehouse=quickstart_catalog' \
      -H "Authorization: Bearer $POLARIS_TOKEN" \
      -H "X-Request-ID: 5678"
  5. Access the following services:

评论

登录后参与评论

正在加载评论…