Attribute usage to applications and teams#

When several teams, departments, or applications share an instant3Dhub deployment, you can add labels to the usage data to track the usage of each team, department, or application separately.

webvis sends usage data in discrete messages (usage pings), see Usage tracking and reporting. Two webvis settings add labels to these pings:

Both settings are optional.

For how usage is tracked, reported to Threedy, and reviewed, see Usage tracking and reporting.

Prerequisites#

Each task needs a different role:

Task

Role

Requirements

Label usage by application

App developer

Access to the webvis settings of the application.

Set the usage group in the application

App developer

Access to the webvis settings of the application.

Derive the usage group from the JWT

Operator

Access to the Helm values. Authentication is enforced. The identity provider puts the claim in the JWT.

Attribution workflow#

The workflow has six steps. The sections below describe them in order; step 3 (generate usage) is part of the verification. In step 2, any combination of the three configuration methods works. Steps 5 and 6 (report and review usage) apply to all usage, labeled or not; see Usage tracking and reporting.

Usage attribution workflow in six steps. Step 1: choose the labels. Step 2: configure one or more of three methods: the application label, the usage group from the client, or the usage group from the JWT. Step 3: generate usage. Step 4: verify the usage ping. Step 5: report the usage. Step 6: review the usage.

Usage attribution workflow#

Usage attribution workflow in six steps. Step 1: choose the labels. Step 2: configure one or more of three methods: the application label, the usage group from the client, or the usage group from the JWT. Step 3: generate usage. Step 4: verify the usage ping. Step 5: report the usage. Step 6: review the usage.

Usage attribution workflow#

Choose labels#

Decide how to group usage before configuring the labels.

  • Match labels to your reporting needs. To know which organizational unit generated usage, use an identifier of the organizational unit as the label. Usage statistics can then be analyzed by each distinct value. Labels that change frequently (per session or per user) create many groups, which are difficult to analyze.

  • Use recognizable labels, but not personal identifiers. Plain department or cost-center identifiers make usage statistics easier to interpret, but, depending on the policies of your organization, they could represent confidential information. Follow the privacy and confidentiality requirements of your organization, and avoid personal identifiers as labels.

  • Set labels before usage starts. Attribution applies only from the moment it is configured. Usage that has already been reported cannot be labeled later. Set the application label at startup, or provide the usage group as a claim in the JWT, so that labeling is performed from the first usage ping.

Configure labels#

Configure one or more of the three methods below.

Label usage by application#

Set applicationIdentifier once at startup. See APPLICATION_IDENTIFIER.

webvis.getContext().changeSetting("applicationIdentifier", "3d-cockpit");
  • Use a stable, descriptive value for each application or service that connects to instant3Dhub.

  • The usage export shows the value in the app_name column.

This value is reported to Threedy, so make sure it complies with your privacy and confidentiality policies.

Without applicationIdentifier, app_name stays empty:

  • For browser applications, instant3Dhub records a hash of the HTTP Origin header in additional_fields.originHash. The hash distinguishes applications from different origins, but it identifies them by hash, not by name.

  • Non-browser clients send no Origin header. To have a stable identifier irrespective of client type, set applicationIdentifier.

Label usage by organizational unit#

The usage group is the organizational dimension. It has two independent sources:

  • From the application: a value set by the application.

  • From the JWT: a value that instant3Dhub derives from the JWT in the request.

Neither value overrides the other. If both are configured, both are included in the usage export separately.

These values are reported to Threedy, so make sure they comply with your privacy and confidentiality policies.

From the application#

Set usageGroup. See USAGE_GROUP.

webvis.getContext().changeSetting("usageGroup", "OS-24");

The export shows the value in additional_fields.usageGroupDirect, exactly as the application sent it.

From the JWT#

This method works across applications without having to adapt them individually.

The request must carry the JWT as Authorization: Bearer <JWT>. instant3Dhub reads no other header or scheme.

List one or more claim names under license.usageGrouping.fromJWTClaims in the Helm values. The Helm chart is described in instant3Dhub on Kubernetes:

license:
  usageGrouping:
    fromJWTClaims:
      - departmentnumber

On each request, instant3Dhub reads the configured claims from the JWT. It reports their values as additional_fields.usageGroupDerived.

If the list has several claim names, instant3Dhub joins their values in the configured order, separated by +. For example, two claims can produce sales+emea.

Choose a claim that the identity provider puts in the JWT itself:

  • departmentnumber is only an example. The correct name depends on the schema of your identity provider.

  • The administrator of your identity provider should know which claims may be used as usage group labels in the JWT.

  • instant3Dhub decodes the JWT that it receives and does not call the identity provider. Therefore, an attribute that the provider gives only at its UserInfo endpoint cannot be a usage group, however the setting is configured.

These values are reported to Threedy, so make sure they comply with your privacy and confidentiality policies.

Verify the labels#

Verify labels in the usage ping#

  1. Start the configured application and open the developer tools of the browser.

  2. Open the Network panel. Filter the requests by resource-gateway-resource/ping.

  3. Use a feature in the application to generate usage. Then wait for the next usage ping.

  4. Open the request payload and verify the configured fields:

    • appName contains the value of applicationIdentifier.

    • usageGroup contains the value of the usageGroup setting in the application.

An excerpt of a usage-ping payload shows these labels together with the identifiers of the application instance and the session:

{
  "appInstanceId": "b6d2f0c4-1e3a-4c7f-9a10-2f5b8c3d7e41",
  "appName": "3d-cockpit",
  "sessionId": "0f9c7a52-8b1d-4e63-bb27-4c9e5a6d1f80",
  "usageGroup": "OS-24"
}

Verify derived usage group labels#

instant3Dhub derives usageGroupDerived from the JWT in the request. Therefore, this field is not in the usage ping that the application sends.

Generate some usage. Then verify the value of additional_fields.usageGroupDerived in one of these sources:

The usage export is the authoritative source for all attribution labels, and the only source for derived ones, since it shows what reached the reporting system.

If the derived group is empty, these are the possible causes:

  • The claim name is wrong, or the JWT does not contain the claim. instant3Dhub silently skips a claim that it cannot read.

  • The session is not authenticated. Deriving a group works only where authentication is enforced. An unauthenticated session presents no JWT, so it produces no derived usage group.

Report and analyze labeled usage#

Labeled usage is reported to Threedy like any other usage; see Report usage. To analyze the labels, use a token consumption report or a manual usage export, which also describes the columns of the export.

Analyze the attribution#

To monitor the token consumption in the exports:

  • Compare exports for consistent reporting periods.

  • Group the records by app_name, usageGroupDirect, or usageGroupDerived.

The example values below show how the three attribution fields can combine:

app_name

usageGroupDirect

usageGroupDerived

3d-cockpit

Not set

4711

3d-cockpit

Not set

4712

visualizr

OS-24

4711

visualizr

LO-620

Not set

In this example:

  • Both applications set an applicationIdentifier.

  • For 3d-cockpit, instant3Dhub derived the departments from claims in the JWT.

  • visualizr sets its groups in the application. Its first row also carries a derived group, so both sources are present. In its second row, only the direct group is present.

Find unlabeled usage#

Unlabeled usage counts toward the token consumption like any other active use. Unexpected unlabeled token consumption can indicate automated activity or a technical account. Investigate the affected sessions before drawing a conclusion. Label automated applications and technical accounts deliberately, so that future reports and exports identify them.

Next steps#