\Drupal\strata\Form TelemetrySettingsForm

Where spans and metrics are sent.

An empty endpoint switches the whole subsystem off, including the tracer, so a site with no collector pays nothing for the instrumentation rather than buffering spans nobody reads.

Headers are entered as one Name: value per line and stored as a mapping. They are the only place an API key belongs, so the field is a plain textarea and its contents are stored in configuration like any other setting - a site that exports its configuration will export this too, which is worth knowing before an authorization token goes in it.

Summary

Methods
Properties
Constants
getFormId
buildForm
validateForm
submitForm
create
No public properties found
SETTINGS
settingKeys
getEditableConfigNames
fieldFor
setting
coerce
engine
No protected constants found
renderHeaders
lines
No private properties found
No private constants found

Constant

SETTINGS

SETTINGS = 'strata.settings'

The configuration object every settings form edits.

Properties

$engine

$engine : ?\Drupal\strata\Engine

The engine, reset after a save.

Type

Engine|null

Methods

getFormId()

getFormId() : string

{@inheritdoc}

Returns

string —

buildForm()

buildForm(array  $form, \Drupal\Core\Form\FormStateInterface  $form_state) : array

{@inheritdoc}

Parameters

array $form
\Drupal\Core\Form\FormStateInterface $form_state

Returns

array —

validateForm()

validateForm(array  $form, \Drupal\Core\Form\FormStateInterface  $form_state) : void

{@inheritdoc}

Parameters

array $form
\Drupal\Core\Form\FormStateInterface $form_state

Returns

void —

submitForm()

submitForm(array  $form, \Drupal\Core\Form\FormStateInterface  $form_state) : void

{@inheritdoc}

Parameters

array $form
\Drupal\Core\Form\FormStateInterface $form_state

Returns

void —

create()

create(\Symfony\Component\DependencyInjection\ContainerInterface  $container) : static

{@inheritdoc}

The engine is asked for, never required. composer.json PSR-4 maps Drupal\strata\ onto src/, so every class here loads off composer's autoloader whether or not the module is in core.extension, while strata.services.yml reaches the container only when it is. A router table still holding this route after the module left - a failed install, a composer remove with no uninstall - therefore resolves the class, calls this, and answered 500 with ServiceNotFoundException until 1.0.3. The property is nullable and every use of it is null-safe, so asking is the whole fix.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container

Returns

static —

settingKeys()

settingKeys() : array<string,string>

The settings this form owns, keyed to their type.

Returns

array

Dotted config key keyed to one of "string", "int", "float" or "bool".

getEditableConfigNames()

getEditableConfigNames() : list<string>

{@inheritdoc}

Returns

list

The configuration this form edits.

fieldFor()

fieldFor(string  $key) : string

The form field a config key is edited by.

Dots are not valid in a form element name, so a nested key is rendered under a flattened one.

Parameters

string $key

The dotted config key.

Returns

string —

The form field name.

setting()

setting(string  $key, mixed  $default = null) : mixed

One current setting.

Parameters

string $key

The dotted config key.

mixed $default

What to return when nothing is configured.

Returns

mixed —

The configured value.

coerce()

coerce(mixed  $value, string  $type) : mixed

Coerces a submitted value to the type the config schema declares.

A form always submits strings, and configuration is schema-validated on save, so an integer setting handed the string "15" fails validation on a site running strictConfigSchema.

Parameters

mixed $value

The submitted value.

string $type

One of "string", "int", "float" or "bool".

Returns

mixed —

The coerced value.

renderHeaders()

renderHeaders() : string

The stored headers, as the textarea shows them.

Returns

string —

One Name: value per line.

lines()

lines(string  $value) : list<string>

The non-empty lines of a textarea.

Parameters

string $value

The submitted value.

Returns

list

The trimmed lines.