MicroStrategy (and SAP HANA)

Collect MicroStrategy cubes, reports and schedules, refresh them from rules, and resolve SAP HANA tables.

Two tools work together here. The MicroStrategy tool (nistor-tool-microstrategy, tool id microstrategy) discovers the objects of a MicroStrategy project, links them to the tables they read, and refreshes cubes and reports from rules. The SAP HANA tool (nistor-tool-sap-hana, tool id sap_hana) has no connection of its own: it recognises SAP tables in the SQL of MicroStrategy cubes so that they appear in lineage.

Installing the MicroStrategy package installs the SAP HANA package. Activate both. The MicroStrategy README calls the tool "Production" and its package carries the Alpha classifier; the SAP HANA README calls it an "identity-only tool" (see the overview and SAP HANA).

What needs more than the public image#

Discovery needs the MicroStrategy SDK, mstrio-py. Its licence is proprietary, so it is the optional extra sdk of the MicroStrategy package, and the public runtime image does not install it. Without it, a compile reports the MicroStrategy connection as failed with "MicroStrategy SDK not installed". Everything else loads and works without it.

Feature What it needs
Discovery: cubes, reports, dashboards, schedules and lineage The sdk extra, in an image you build yourself (below)
Refreshing cubes, reports and incremental refresh reports; firing events Nothing more
Watching refreshes that started outside Nistor; per-object usage from Platform Analytics Nothing more
Cube, dashboard and refresh data-quality checks The Data quality module (Nistor Enterprise)

To add the SDK, activate the two tools and put the extra in your distribution file, then build the image with nistor dist build --tag:

[activation]
tools = ["gcp", "microstrategy", "sap_hana"]

[packages]
extras = { nistor-tool-microstrategy = ["sdk"] }

The build leaves mstrio-py out of the third-party licence check, because the public policy has no exception for it. The image then contains software under MicroStrategy's licence: keep it private. The sdk extra accepts mstrio-py 11.5 up to, but not including, 11.7. See the overview for locks.

Create the connection#

Create a connection of type microstrategy in the web shell (Connections, /admin/connections) or with POST /api/v1/connections:

Field Required Meaning
base_url yes The MicroStrategy Library URL, for example https://reporting.example.com/MicroStrategyLibrary.
username yes The account Nistor logs in as.
project_id no The project the connection works in.
project_name no Its name.
login_mode no Default 1.
application_type no Default 35 (Library). Change it if your account cannot log in as a Library client.

The only secret is password.

The test asks the Library for its status (GET /api/status), then logs in and out. The Intelligence Server must be version 11.3 up to, but not including, 11.7; another version is unhealthy, and no session is opened. If the Library does not report its version but the login works, the test answers degraded.

Where each part reads its credentials#

Three parts of the tool log in to MicroStrategy, and they do not all read the connection:

Part Runs in Credentials
Discovery the compiler The connection named by connection_id in the compile entry. Without one, the environment variables below (deprecated, kept for one major version).
microstrategy_refresh and microstrategy_event_trigger the scheduler MSTR_SERVER_URL, MSTR_USERNAME and MSTR_PASSWORD, when all three are set in the scheduler's environment. Otherwise the default microstrategy connection.
The pollers: runs started outside Nistor, Platform Analytics reads the backend and jobs MSTR_SERVER_URL, MSTR_USERNAME and MSTR_PASSWORD from the environment only.

So set the three variables on the scheduler, backend and jobs roles as well as creating the connection. The enable_microstrategy Terraform switch of the reference root (below) sets them on the scheduler, compiler and dq-executor. The provider module also outputs a variable set for the backend and jobs (backend_env_vars), which the reference root does not wire: do that in your deployment root.

Tell the compiler what to scan#

Add a microstrategy entry to the environment's compiler configuration and save it with nistor compiler sync (see CLI):

[
  {
    "environment": "prod",
    "tools": [
      {
        "id": "microstrategy",
        "config": {
          "connection_id": "<connection-uuid>",
          "project_ids": ["<project-id>"],
          "default_bq_project": "acme-data-prod",
          "object_types": { "users": true }
        }
      }
    ]
  }
]
  • project_ids lists the MicroStrategy projects to read.
  • default_bq_project is the BigQuery project assumed for two-part table names in cube SQL. Without it, Nistor takes the project from three-part names in the same SQL.
  • object_types switches a kind of object on or off. On by default: cubes, dashboards, documents, reports, refreshReports, schedules, events and subscriptions. Off by default: datasources, tables, facts and users.
  • If the connection fails, the compile keeps the previous MicroStrategy nodes instead of dropping them.

What it collects#

The tool declares 14 node types: MicrostrategyCube, MicrostrategyDashboard, MicrostrategyDocument, MicrostrategyReport, MicrostrategyIncrementalRefreshReport, MicrostrategySchedule, MicrostrategyEvent, MicrostrategySubscription, MicrostrategyDatasource, MicrostrategyTable, MicrostrategyFact, MicrostrategyUser, MicrostrategyAttribute and MicrostrategyMetric. A node id is <NodeType>_<object-id>-<project-id>.

Lineage, with the SDK:

  • A cube takes its attributes and metrics as ancestors, and the BigQuery tables and SAP HANA tables that its SQL view reads.
  • A report takes the BigQuery tables its SQL reads.
  • A dashboard takes the datasets it uses.
  • An incremental refresh report takes its target cube. Resolving it needs a MicroStrategy privilege (below).

Refreshes that Nistor did not start are observed. Every 60 seconds (MSTR_EXTERNAL_RUN_POLL_INTERVAL_SECONDS) a poller reads the Intelligence Server job monitor and records running jobs, then resolves their outcome on a later tick: the monitor drops a job once it finishes. By default it watches only the objects that an active rule manages. Set MSTR_OBSERVE_ALL_EXECUTIONS=true to watch the whole catalogue and to record reads as well.

Usage comes from MicroStrategy Platform Analytics. An hourly poll records read events, and the shell can load the history of one object on demand. The object ids of the Platform Analytics project and cubes are settings (MSTR_PA_*) with defaults.

Freshness of a cube comes from its last update time.

SAP HANA#

The SAP HANA tool reaches no SAP system. It has no connection, no executor and no settings, and its health probe always answers healthy ("no connection: identity-only tool"). Nistor never logs in to SAP HANA, and no SAP credential is needed.

What it does is read SQL. For each cube SQL view that the MicroStrategy tool reads, it finds FROM and JOIN references whose schema looks like SAP: _SYS_BIC, _SYS_BI0 and other _SYS_ schemas (HANA calculation views and BW InfoCubes), SAP followed by letters or digits such as SAPABAP1 and SAPSR3 (ECC and S/4HANA tables), or any schema name containing HANA or BW. Each reference becomes a SapHanaTable node:

SapHanaTable_PRD_<schema>_<object>

/ and . in the object path become -. The system part is PRD for every table that the MicroStrategy tool finds. Only cube SQL views are read, not report SQL. Without the SAP HANA tool active, cubes compile without their SAP sources.

Refresh from rules#

Two executors ship with the tool. Both need the Nistor permission actions:run_microstrategy.

Action type Does Parameters
microstrategy_refresh Refreshes a cube (an asynchronous publish through the REST API), executes a report to regenerate its cache, or runs an incremental refresh report. The object comes from the node, or from the parameters. cube_ids, report_ids, irr_ids, project_id, downstream_timeout_seconds
microstrategy_event_trigger Fires a MicroStrategy event, which runs every schedule subscribed to it. The refreshes it causes are tracked as child runs. event_ids, project_id

Set project_id in the parameters. Without it the executor uses a project id fixed in the code, which will not be yours.

- name: Refresh the acme sales cube when its tables are loaded
  priority: 5
  status: active
  code_id: bi/acme-sales-cube-refresh
  applies_to:
    node_ids:
      - MicrostrategyCube_<cube-id>-<project-id>
  when:
    events:
      - origin: ancestors
        types: data_updated
        ancestor_depth: direct
    wait_for_all_ancestors: true
  if:
    quiet_period_seconds: 300
  then:
    target:
      same_as_applies_to: true
      scope: node
    do:
      kind: single
      action:
        type: microstrategy_refresh
        parameters:
          project_id: <project-id>

Check it with nistor rules validate --files <file>. See Rules and scheduling.

How a refresh behaves:

  • If MicroStrategy answers a transient error or a lock conflict before it returns a job id, Nistor retries with a backoff for up to 180 seconds (MSTR_TRIGGER_PATIENCE_SECONDS).
  • A cube refresh is not finished at the first update of the cube: Nistor waits for the publish step to settle. When the job monitor cannot say, it trusts the cube's last update time once that is older than MSTR_CUBE_PUBLISH_SETTLE_SECONDS (120 seconds).
  • After three failures in a row the circuit breaker opens for 120 seconds, so that a MicroStrategy server at its session limit is not hammered.
  • An interrupted dispatch is failed, not started again.
  • The cost of a refresh is reconstructed from the BigQuery work it caused, in a time window around the run. There is no pre-flight cost estimate.

A poller whose login MicroStrategy rejects (401 or 403) opens a configuration incident, skips its tick, and waits 15 minutes between login attempts until the login works again (MSTR_AUTH_BACKOFF_MINUTES).

Permissions#

Give the MicroStrategy account these rights. Nistor checks the first two before a rule runs.

Right Needed for
Execute on the cube, report or incremental refresh report microstrategy_refresh
Use on the event microstrategy_event_trigger
Read access to the objects to discover Discovery
The privilege Web Report SQL Cube SQL views, and so lineage. Without it a cube yields no sources.
The privilege Web object search Resolving the target cube of an incremental refresh report by a dependency search
The privilege Web create new Report The direct lookup of that target cube. Without it Nistor falls back to the dependency search.
The privilege Web use Metric Editor Optional: the formulas of metrics. Without it a metric is kept without its formula.
Access to the Platform Analytics project Usage reads

A cube whose SQL view the account cannot read, or whose privilege it lacks, yields no sources. The compile goes on and logs the gap as one for a MicroStrategy administrator to close.

Settings#

These environment variables tune the tool. Defaults are in brackets.

Variable Meaning
MSTR_SERVER_URL, MSTR_USERNAME, MSTR_PASSWORD The credentials of the settings path (see above). The settings object also looks up MSTR_PASSWORD in the secrets provider as mstr-password-<ENVIRONMENT>.
MSTR_MAX_SESSIONS_PER_PROCESS Sessions one pool may hold (2). The pool is also the concurrency limit.
MSTR_SESSION_IDLE_EVICT_SECONDS How long a pooled session may sit idle before it is dropped (1500).
MSTR_SESSION_ACQUIRE_TIMEOUT_SECONDS How long an action waits for a free session (3600).
MSTR_CAPACITY_BACKOFF_MINUTES The wait between login attempts while MicroStrategy is at its session cap (15; 0 disables).
MSTR_AUTH_BACKOFF_MINUTES The wait between login attempts while an authentication incident is open (15).
MSTR_CB_FAILURE_THRESHOLD, MSTR_CB_RECOVERY_TIMEOUT The circuit breaker: failures before it opens (3) and its cooldown in seconds (120).
MSTR_TRIGGER_PATIENCE_ENABLED, MSTR_TRIGGER_PATIENCE_SECONDS The retry window before a job id exists (on, 180).
MSTR_IRR_CROSS_VISIBILITY_ENABLED Also show an incremental refresh run on its cube's activity page (off).
MSTR_IRR_DOWNSTREAM_TRACKING_ENABLED Track the refreshes that an incremental refresh run causes (on).
MSTR_EXTERNAL_RUN_POLL_INTERVAL_SECONDS How often runs started outside Nistor are polled (60).
MSTR_OBSERVE_ALL_EXECUTIONS Watch the whole catalogue, not only managed objects (off).
MSTR_USAGE_EXCLUDED_USERS Comma-separated accounts left out of usage figures, such as a monitoring robot (none).
MSTR_COMPILER_REQUEST_TIMEOUT_SECONDS The read timeout of discovery requests (180).
MSTR_PA_CACHE_READ_ENABLED Per-execution reads of cubes from Platform Analytics, in addition to hourly counts (on).

Terraform#

The reference root has a switch, enable_microstrategy (off by default). With it on, the provider module creates the secret for the password and sets MSTR_* on the scheduler, compiler and dq-executor. Its inputs are mstr_server_url, mstr_username, mstr_password (pass it as TF_VAR_mstr_password, never in a file), mstr_project_name, mstr_project_id, max_concurrent_mstr_workers (3), max_concurrent_mstr_operations (2), mstr_max_retries (5), mstr_retry_initial_delay (10 seconds) and mstr_retry_max_delay (300 seconds). See Install on GCP.

Edit this page on GitLab

↑ ↓ to moveEnter to openEsc to close