NAME

Sentry::DSN - The parts of a Sentry DSN

SYNOPSIS

my $dsn = Sentry::DSN->parse('https://key@o1.ingest.sentry.io/42');

$dsn->host;          # o1.ingest.sentry.io
$dsn->project_id;    # 42
$dsn->user;          # key, the public key

DESCRIPTION

A DSN tells the SDK where to send events: {protocol}://{public_key}@{host}{path}/{project_id}. "new" in Sentry::Transport::Http takes one.

METHODS

parse

my $dsn = Sentry::DSN->parse($string);

The DSN of the string; the string itself if it is false (undef, empty). Does not validate it; "init" in Sentry::SDK does.

protocol, host, port, host_port

The scheme in lower case (https or http), the host (an IPv6 address in brackets), the port (undef if the DSN names none) and host:port (the host alone without port).

user, pass

The public key, and the deprecated secret key if any (URL-unescaped).

path

The path before the project id, e.g. /sentry if Sentry runs below /sentry, else ''.

project_id

The project id, the number at the end of the path.

org_id

The organization id of a host like o1234.ingest.sentry.io (sentry.io), undef for other hosts.

to_string

The DSN as given, secret key included: for the SDK's own processes (see Sentry::Transport::SenderProcess), never for events.

to_public_string

The DSN without the secret key.

SEE ALSO

"dsn" in Sentry::SDK