Despliegue
El Procesador de Métricas IPF es bastante ligero y puede ser implementado como una única instancia, pero puede ser escalado más allá de una única instancia si es necesario. El número de instancias no debe exceder el número de particiones de la IPF Processing Data tema (IPF_PROCESSING_DATA).
Docker
El Procesador de Métricas IPF se produce como un docker imagen, y por lo tanto puede ejecutarse en entornos contenedorizados.
El siguiente es un ejemplo mínimo docker componer el despliegue, suficiente para poner en marcha el Procesador de Métricas IPF, sin embargo, le faltan varios otros componentes requeridos:ODS Ingestion, que es necesario para procesar el pago processing data para la búsqueda en algunos escenarios; una aplicación de procesamiento de pagos IPF para generar datos para el IPF_PROCESSING_DATA tema; ambos Prometheus y Grafana; y posiblemente ODS Inquiry, dependiendo de la configuración del Procesador de Métricas IPF.
Este ejemplo docker la composición del despliegue podría utilizarse como un punto de partida para un Kubernetes despliegue.
Docker Compose
services:
ipf-metrics-processor:
image: ${docker.registry}/ipf-metrics-processor:latest
container_name: ipf-metrics-processor
ports:
- "8080:8080"
volumes:
- ./config/ipf-metrics-processor:/ipf-metrics-processor/conf
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/actuator/health" ]
interval: 1s
timeout: 1s
retries: 3
start_period: 30s
mongo:
image: ${docker.registry}/ipf-docker-mongodb:latest
container_name: mongo
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet
zookeeper:
image: zookeeper
container_name: zookeeper
kafka:
image: registry.ipf.iconsolutions.com/kafka-icon:2.13-2.7.1
container_name: kafka
environment:
- KAFKA_BROKER_ID=0
- KAFKA_AUTO_CREATE_TOPICS_ENABLE=false
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_LOG_RETENTION_MINUTES=60
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
- KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS=1
- KAFKA_LISTENERS=INTERNAL://:9092,EXTERNAL://:9093
- KAFKA_ADVERTISED_LISTENERS=INTERNAL://kafka:9092,EXTERNAL://localhost:9093
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_INTER_BROKER_LISTENER_NAME=INTERNAL
- KAFKA_CREATE_TOPICS=IPF_PROCESSING_DATA:10:1
depends_on:
- zookeeper
Configuración
management.endpoints.web.exposure.include = "*"
ipf.mongodb.url = "mongodb://mongo:27017/ipf"
ipf.processing-data.ingress.kafka.consumer.kafka-clients.bootstrap.servers = "kafka:9092"
Requisitos
Una conexión a la ODS se requiere una base de datos para que payment flows puede resolverse para determinar el terminal state de un pago, y en algunos casos para recuperar datos que pueden estar faltando.
Una conexión a Kafka es requerido, para que pueda consumir IPF Processing Data.
ODS Ingestion debe estar también en funcionamiento. ODS se espera que persista process flow definitions, y todos los demás datos relacionados con el pago que puedan ser necesarios para producir métricas.
Configuración
Infraestructura
El Procesador de Métricas IPF es un IPF Processing Data Ingreso, es decir, utiliza el predefinido Kafka receive connector s para consumir datos. Vea el IPF Processing Data documentation para opciones de configuración.
El procesador de métricas IPF debe conectarse a la ODS MongoDB instancia-la URL de conexión se define con ipf.mongodb.url, p. ej.ipf.mongodb.url = "mongodb://ipf-mongo:27017/ipf"
Para gestionar el tamaño del interno cache, el Procesador de Métricas IPF desaloja todos los datos de un pago de la cache después de un tiempo configurado. El cache expira un pago después de que haya transcurrido la duración especificada desde que se accedió al pago por última vez mediante una lectura o una escritura.
Esta duración se define con ipf.business-metrics-processor.cache.expire-after-access, que por defecto es de 10 minutos cuando no está configurado.
ODS Inquiry Configuración
El Procesador de Métricas IPF puede configurarse opcionalmente para consultar ODS Inquiry en lugar de una conexión directa a la ODS MongoDB instancia. Esto requiere una instancia de ODS Inquiry para ser implementado junto con el Procesador de Métricas, y la siguiente configuración dentro del Procesador de Métricas IPF para instanciar el Consulta del cliente conectores:
ods.inquiry.client {
version = 3
// Only the process object and pds object connectors are required
process-objects.enabled = true
pds-objects.enabled = true
// Replace with your deployed ODS Inquiry host and port
http.client {
host = "ods-inquiry-host"
port = 8080
}
}
Características
Algunas características de las métricas producidas deben ser habilitadas y configuradas explícitamente. El siguiente es un ejemplo básico de configuración.
Ejemplo de Configuración de Notación Estándar
ipf.business-metrics-processor.payment-metrics {
versioned-labels {
direction {
payment-type-mappings = [
{
label = "Outbound"
payment-types = ["DebtorCT"]
}
{
label = "Inbound"
payment-types = ["CreditorCT"]
}
{
label = "Internal"
payment-types = ["Book Transfer"]
}
]
}
currency = [
{
pds-type = SomeClientSpecificPdsType
path = "/details/paymentAmount/currency"
}
]
local-instrument =[
{
pds-type = SomeClientSpecificPdsType
path = "/details/localInstrument/instrument"
}
]
identity-comparison = [
{
pds-type = SomeClientSpecificPdsType
path = "/details/comparison/result"
}
]
client-channel =[
{
pds-type = SomeClientSpecificPdsType
path = "/details/clientChannel/channel"
}
]
}
######################################################################################################
# The below configuration is not necessary out-of-the-box, and exists for backward-compatibility.
# It is also deprecated and will be unsupported in future versions.
######################################################################################################
# Optional if using a version of HTM that produces events with the `HTM` label, or when payment flows produce events
# with labels indicating the payment went through HTM
htm {
events = ["Task Registration Successful", "Task Registration Failed"]
}
payment-duration {
# Optional if the payment flows produce events with labels indicating the start and end of the critical path
critical-path {
critical-path-states-by-payment-type = [
{
payment-type = "Debtor CT"
start-state = "Validating"
end-state = "Instructing"
}
]
}
# Optional if the payment flows produce events with labels indicating the which states are considered waiting states
waiting {
waiting-states-by-flow = [
{
flow-name = "PaymentExecutionFlowV1"
states = ["Checking Bank System A", "Checking Bank System B"]
}
{
flow-name = "PaymentExecutionFlowV2"
states = ["Checking Bank System B", "Checking Bank System C"]
}
]
}
}
}
Hocon La notación de puntos también es compatible.
Ejemplo de Configuración de Notación de Puntos
ipf.business-metrics-processor.payment-metrics.labels.direction.payment-type-mappings.0.label = "Outbound"
ipf.business-metrics-processor.payment-metrics.labels.direction.payment-type-mappings.0.payment-types.0 = "DebtorCT"
ipf.business-metrics-processor.payment-metrics.labels.direction.payment-type-mappings.1.label = "Inbound"
ipf.business-metrics-processor.payment-metrics.labels.direction.payment-type-mappings.1.payment-types.0 = "CreditorCT"
ipf.business-metrics-processor.payment-metrics.labels.direction.payment-type-mappings.2.label = "Internal"
ipf.business-metrics-processor.payment-metrics.labels.direction.payment-type-mappings.2.payment-types.0 = "Book Transfer"
ipf.business-metrics-processor.payment-metrics.labels.currency.pds-type = SomeClientSpecificPdsType
ipf.business-metrics-processor.payment-metrics.labels.currency.path = "details.paymentAmount.currency"
ipf.business-metrics-processor.payment-metrics.labels.local-instrument.pds-type = SomeClientSpecificPdsType
ipf.business-metrics-processor.payment-metrics.labels.local-instrument.path = "details.localInstrument.instrument"
ipf.business-metrics-processor.payment-metrics.labels.identity-comparison.pds-type = SomeClientSpecificPdsType
ipf.business-metrics-processor.payment-metrics.labels.identity-comparison.path = "details.comparison.result"
ipf.business-metrics-processor.payment-metrics.labels.client-channel.pds-type = SomeClientSpecificPdsType
ipf.business-metrics-processor.payment-metrics.labels.client-channel.path = "details.clientChannel.channel"
######################################################################################################
# The below configuration is not necessary out-of-the-box, and exists for backward-compatibility.
# It is also deprecated and will be unsupported in future versions.
######################################################################################################
# Optional if using a version of HTM that produces events with the `HTM` label, or when payment flows produce events
# with labels indicating the payment went through HTM
ipf.business-metrics-processor.payment-metrics.labels.htm.events.0 = "Task Registration Successful"
ipf.business-metrics-processor.payment-metrics.labels.htm.events.1 = "Task Registration Failed"
# Optional if the payment flows produce events with labels indicating the start and end of the critical path
ipf.business-metrics-processor.payment-metrics.payment-duration.critical-path.critical-path-states-by-payment-type.0.payment-type = "Debtor CT"
ipf.business-metrics-processor.payment-metrics.payment-duration.critical-path.critical-path-states-by-payment-type.0.start-state = "Validating"
ipf.business-metrics-processor.payment-metrics.payment-duration.critical-path.critical-path-states-by-payment-type.0.end-state = "Instructing"
# Optional if the payment flows produce events with labels indicating the which states are considered waiting states
ipf.business-metrics-processor.payment-metrics.payment-duration.waiting.waiting-states-by-flow.0.flow-name = "PaymentExecutionFlowV1"
ipf.business-metrics-processor.payment-metrics.payment-duration.waiting.waiting-states-by-flow.0.states.0 = "Checking Bank System A"
ipf.business-metrics-processor.payment-metrics.payment-duration.waiting.waiting-states-by-flow.0.states.1 = "Checking Bank System B"
ipf.business-metrics-processor.payment-metrics.payment-duration.waiting.waiting-states-by-flow.1.flow-name = "PaymentExecutionFlowV2"
ipf.business-metrics-processor.payment-metrics.payment-duration.waiting.waiting-states-by-flow.1.states.0 = "Checking Bank System B"
ipf.business-metrics-processor.payment-metrics.payment-duration.waiting.waiting-states-by-flow.1.states.1 = "Checking Bank System C"