Skip to main content
Version: v3.6.x LTS

Log signal examples and attribute mapping

Log signal examples and attribute mapping

The following scenarios represent common log signals emitted by API ML. Each example includes the specific attributes present in the signal body and the resulting JSON payload.

A Service registered successfully to API ML Discovery Service​

This signal is emitted when an onboarded service instance successfully registers its metadata with the Discovery Service registry.

  • http.request.method
    The HTTP verb (POST).
  • service.id
    The logical ID of the Discovery service.
  • service.instance.id
    The specific host and port of the Discovery instance.
  • service.response_code
    The status returned by the registry (204).
  • url.path
    The Eureka registration endpoint.
  • url.scheme
    The communication protocol (https).
{
"http.request.method": "POST",
"service.id": "discovery",
"service.instance.id": "localhost:discovery:10011",
"service.response_code": "204",
"url.path": "/eureka/apps/<service Id>",
"url.scheme": "https"
}

This signal confirms that the onboarding is accepted by the Discovery Service.

A Service sent a successful heartbeat​

This signal indicates that an active service instance has successfully renewed its lease with the Discovery Service to maintain its availability status.

  • http.request.method
    The HTTP verb (PUT).

  • service.id
    The ID of the service that recorded the request (discovery). The ID of the service that sent the heartbeat is in url.path.

  • service.instance.id
    The Discovery Service instance that received the heartbeat. The sending instance is identified in url.path.

  • service.response_code
    The status of the heartbeat renewal (200).

  • url.path
    The Eureka lease renewal path in the form /eureka/apps/<service Id>/<instance ID>. The path identifies the service and the instance that sent the heartbeat.

  • url.scheme
    The communication protocol (https).

{
"http.request.method": "PUT",
"service.id": "discovery",
"service.instance.id": "localhost:discovery:10011",
"service.response_code": "200",
"url.path": "/eureka/apps/<service Id>/localhost:<service Id>:10012",
"url.scheme": "https"
}

This signal confirms discovery received the health information from the service (service Id).

note

To aggregate heartbeat activity by sending service instance, group by the instance ID segment of url.path. Grouping by service.instance.id instead groups by the receiving Discovery instance.

A successful login attempt​

This signal captures a successful authentication event initiated by a user through the API ML Gateway login endpoint.

  • http.request.method
    The HTTP verb (POST).

  • service.id
    The logical ID for the Gateway.

  • service.instance.id
    The Gateway instance handling the authentication.

  • service.response_code
    The status of the login request (204).

  • url.path
    The authentication login endpoint.

  • url.scheme
    The communication protocol (https).

{
"http.request.method": "POST",
"service.id": "gateway",
"service.instance.id": "localhost:gateway:10010",
"service.response_code": "204",
"url.path": "/gateway/api/v1/auth/login",
"url.scheme": "https"
}

This signal confirms that the Gateway has successfully validated the inbound client credentials, establishing the active session required to authorize subsequent routed API requests.

A successful request to API ML Catalog (HTTP 200)​

This signal represents a request to the API Catalog service that returned HTTP 200. This signal is typically used for retrieving container or service metadata. The record contains only request metadata and the response status code.

  • http.request.method
    The HTTP verb (GET).

  • service.id
    The logical ID of the API Catalog.

  • service.instance.id
    The instance providing catalog data.

  • service.response_code
    The success status (200).

  • url.path
    The endpoint for retrieving containers.

  • url.scheme
    The communication protocol (https).

{
"http.request.method": "GET",
"service.id": "apicatalog",
"service.instance.id": "localhost:apicatalog:10010",
"service.response_code": "200",
"url.path": "/apicatalog/api/v1/containers",
"url.scheme": "https"
}

This signal confirms that the request reached the API Catalog and that the API Catalog returned HTTP 200. Neither response contents, nor the size of the service registry are included. As such, you cannot use this signal to determine if the response is populated or empty.

This record also contains no authentication attributes (such as auth.method or auth.status), so the record does not show whether or how the request was authenticated. For an example of a record that includes authentication details, see Valid authentication when routing to an onboarded service (Zowe JWT).

Valid authentication when routing to an onboarded service (Zowe JWT)​

This signal describes a request successfully authenticated via a Zowe JWT that has been routed to a downstream onboarded service.

  • auth.method
    The general authentication type (JWT).

  • auth.service.auth.method
    The specific Zowe provider (zoweJwt).

  • auth.status
    The final result of authentication (OK).

  • http.request.method
    The HTTP verb (GET).

  • service.id
    The logical ID of the Zowe JWT service.

  • service.instance.id
    The unique service instance identifier.

  • service.response_code
    The successful status code (200).

  • url.path
    The routed request endpoint.

  • url.scheme
    The communication protocol (https).

  • user.id
    The identifier of the authenticated user.

{
"auth.method": "JWT",
"auth.service.auth.method": "zoweJwt",
"auth.status": "OK",
"http.request.method": "GET",
"service.id": "zowejwt",
"service.instance.id": "static-localhost:zowejwt:10012",
"service.response_code": "200",
"url.path": "/zowejwt/api/v1/request",
"url.scheme": "https",
"user.id": "USER"
}

This signal verifies an end-to-end successful transaction where the user's identity was validated via token and securely propagated to the target downstream microservice.

Invalid authentication when routing to an onboarded service (Zowe JWT)​

This signal describes a request with an expired Zowe JWT token that was routed to a downstream onboarded service.

  • auth.service.auth.method The specific Zowe provider (zoweJwt).

  • auth.status The final result of authentication (ERROR).

  • auth.error.message A description of the error message.

  • auth.error.type Type of error.

  • http.request.method The HTTP verb (GET).

  • service.id The logical ID of the Zowe JWT service.

  • service.instance.id The unique service instance identifier.

  • service.response_code The successful status code (401).

  • url.path The routed request endpoint.

  • url.scheme The communication protocol (https).

The following example presents the payload when an expired token has been used.

Example:

{
"auth.service.auth.method": "zoweJwt",
"auth.status": "ERROR",
"auth.error.message": "ZWEAO402E The request has not been applied because it lacks valid authentication credentials.",
"auth.error.type": "org.zowe.apiml.security.common.token.TokenExpireException",
"http.request.method": "GET",
"service.id": "<service Id>",
"service.instance.id": "static-localhost:<service Id>:10012",
"service.response_code": "401",
"url.path": "/<service Id>/api/v1/request",
"url.scheme": "https"
}

This signal confirms that while the API ML failed to validate the authentication credentials, the Gateway still routed the request downstream, resulting in the target service (zowejwt) rejecting the request with a 401 unauthorized response.