Getting started with Uptrace

Getting started with Uptrace is easy:

  1. To host Uptrace yourself, download and install Uptrace binary. Or createopen in new window a free cloud account and let us manage Uptrace for you.

  2. To start receiving data, use the DSN (connection string) you've obtained on the previous step to configure Uptrace distro for your programming language.

  1. Instrumentopen in new window your application with plugins for popular frameworks and libraries.

  2. Install OpenTelemetry Collector to monitor host metrics, Redis, PostgreSQL, MySQL and many more.

  3. You can also use Vector to collect logs from a file or a syslog.

Have questions? Get help via Telegramopen in new window or start a discussionopen in new window on GitHub.

Resource attributes

Resource attributes are key-value pairs that provide metadata about the entity being monitored, such as a service, process, or container. They help to identify the resource and provide additional information that can be used for filtering and grouping telemetry data.

For the full list of attributes, see Semantic attributesopen in new window, but here are the most popular resource attributes to get you started.

AttributeComment
service.nameopen in new windowLogical name of the service. Uptrace provides an overview of all services.
service.versionopen in new windowThe version string of the service API or implementation.
deployment.environmentopen in new windowName of the deployment environment (aka deployment tier). Uptrace groups spans from different environments separately.
host.nameopen in new windowName of the host. Usually, resource detectors discover and set this attribute automatically.

You can set those attributes by providing the OTEL_RESOURCE_ATTRIBUTES environment variable:

export OTEL_RESOURCE_ATTRIBUTES=service.name=myservice,service.version=1.0.0,deployment.environment=production

Or you can configure them during OpenTelemetry initialization:

// https://uptrace.dev/get/opentelemetry-go.html

import "github.com/uptrace/uptrace-go/uptrace"

uptrace.ConfigureOpentelemetry(
    // copy your project DSN here or use UPTRACE_DSN env var
    //uptrace.WithDSN(""),

	uptrace.WithServiceName("myservice"),
	uptrace.WithServiceVersion("v1.0.0"),
	uptrace.WithDeploymentEnvironment("production"),
)
# https://uptrace.dev/get/opentelemetry-python.html

import uptrace

# copy your project DSN here or use UPTRACE_DSN env var
uptrace.configure_opentelemetry(
  dsn="",
  service_name="myservice",
  service_version="1.0.0",
  deployment_environment="production",
)
# https://uptrace.dev/get/opentelemetry-ruby.html

require 'uptrace'

# copy your project DSN here or use UPTRACE_DSN env var
Uptrace.configure_opentelemetry(dsn: '') do |c|
  # c is OpenTelemetry::SDK::Configurator
  c.service_name = 'myservice'
  c.service_version = '1.0.0'

  c.resource = OpenTelemetry::SDK::Resources::Resource.create(
    'deployment.environment' => 'production'
  )
end
// https://uptrace.dev/get/opentelemetry-js-node.html

const uptrace = require('@uptrace/node')

uptrace
  .configureOpentelemetry({
    // copy your project DSN here or use UPTRACE_DSN env var
    //dsn: '',
    serviceName: 'myservice',
    serviceVersion: '1.0.0',
    deploymentEnvironment: 'production',
  })
  // Start OpenTelemetry SDK.
  .start()
  // Then execute the main function when SDK is ready.
  .then(main)
// https://uptrace.dev/get/opentelemetry-php.html

$conf = new Uptrace\Config();
// copy your project DSN here or use UPTRACE_DSN env var
//$conf->setDsn('');
$conf->setServiceName('myservice');
$conf->setServiceVersion('1.0.0');
$conf->setDeploymentEnvironment('production');

$uptrace = new Uptrace\Distro($conf);
$tracerProvider = $uptrace->createTracerProvider();

DSN

Uptrace DSN is a connection string that contains connections details for an Uptrace backend and a secret token that grants write access to a project.

For example, DSN http://project1_secret_token@localhost:14317/1 contains the following information:

  • http tells the client to disable TLS. Use https to enable TLS.
  • localhost:14317 is an address of the Uptrace backend. The cloud version always uses the uptrace.dev address without a port.
  • project1_secret_token is a secret token that is used for authentication.
  • /1 is a project id.

You can always find your project DSN on the project settings page or by clicking on the Help icon:

Uptrace DSN

Last Updated: