Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Overview

Lark is an all-in-one productivity solution that includes chat, scheduling, docs, video conferencing, auto-translation and more in a single platform.

Devo collector features

Feature

Details

Allow parallel downloading (multipod)

not allowed

Running environments

  • collector server

  • on-premise

Populated Devo events

table

Flattening preprocessing

no

Data sources

Data source

Description

API endpoint

Collector service name

Devo table

Available from release

audit_infos

Returns all the audit logs.

admin/v1/audit_infos

audit_infos

app.lark.audit.event

v1.0.0

For more information on how the events are parsed, visit our page.

Flattening preprocessing

Data source

Collector service

Optional

Flattening details

audit_infos

audit_infos

yes

not required

Minimum configuration required for basic pulling

Although this collector supports advanced configuration, the fields required to retrieve data with basic configuration are defined below.

This minimum configuration refers exclusively to those specific parameters of this integration. There are more required parameters related to the generic behavior of the collector. Check setting sections for details.

Setting

Details

app_id

The app ID to generate the auth token for authentication.

app_secret

The app secret key to.generate the auth token for authentication.

The auth token timeout specified in Lark official documentation is 2 hours, but we are using it as 40 minutes as the token expires around that time.

Accepted authentication methods

Authentication method

app_id

app_secret

Bearer auth token

REQUIRED

REQUIRED

Run the collector

Once the data source is configured, you can either send us the required information if you want us to host and manage the collector for you (Cloud collector), or deploy and host the collector in your own machine using a Docker image (On-premise collector).

Collector services detail

This section is intended to explain how to proceed with specific actions for services.

Audit info

 Verify data collection

Once the collector has been launched, it is important to check if the ingestion is performed in a proper way. To do so, go to the collector’s logs console.

This service has the following components:

Component

Description

Setup

The setup module is in charge of authenticating the service and managing the token expiration when needed.

Puller

The setup module is in charge of pulling the data in a organized way and delivering the events via SDK.

Setup output

A successful run has the following output messages for the setup module:

2024-06-24T08:09:59.388    INFO OutputProcess::MainThread -> ConsoleSenderManager(lookup_senders,manager,console_1) -> Starting thread
2024-06-24T08:09:59.389    INFO OutputProcess::MainThread -> DevoSender(internal_senders,devo_sender_0) -> Starting thread
2024-06-24T08:09:59.390    INFO OutputProcess::ConsoleSenderManager(lookup_senders,manager,console_1) -> [EMERGENCY PERSISTENCE SYSTEM] ConsoleSenderManager(lookup_senders,manager,console_1) -> Nothing retrieved from the persistence.
2024-06-24T08:09:59.390    INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(internal_senders,devo_2) -> Starting thread (every 300 seconds)
2024-06-24T08:09:59.391    INFO OutputProcess::OutputLookupConsumer(lookup_senders_consumer_0) -> [EMERGENCY PERSISTENCE SYSTEM] OutputLookupConsumer(lookup_senders_consumer_0) -> Nothing retrieved from the persistence.
2024-06-24T08:09:59.391    INFO OutputProcess::MainThread -> DevoSenderManager(internal_senders,manager,devo_2) -> Starting thread
2024-06-24T08:09:59.392    INFO OutputProcess::MainThread -> ConsoleSender(internal_senders,console_sender_0) -> Starting thread
2024-06-24T08:09:59.392    INFO OutputProcess::MainThread -> ConsoleSenderManagerMonitor(internal_senders,console_1) -> Starting thread (every 300 seconds)
2024-06-24T08:09:59.393    INFO OutputProcess::DevoSenderManager(internal_senders,manager,devo_2) -> [EMERGENCY PERSISTENCE SYSTEM] DevoSenderManager(internal_senders,manager,devo_2) -> Nothing retrieved from the persistence.
2024-06-24T08:09:59.393    INFO OutputProcess::MainThread -> ConsoleSenderManager(internal_senders,manager,console_1) -> Starting thread
2024-06-24T08:09:59.395    INFO OutputProcess::ConsoleSenderManager(internal_senders,manager,console_1) -> [EMERGENCY PERSISTENCE SYSTEM] ConsoleSenderManager(internal_senders,manager,console_1) -> Nothing retrieved from the persistence.
2024-06-24T08:10:00.212    INFO InputProcess::LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Successfully generated auth token for Lark API
2024-06-24T08:10:00.216    INFO OutputProcess::ConsoleSender(internal_senders,console_sender_0) -> {"message_timestamp": "2024-06-24 02:40:00.213", "message_tag": "devo.collectors.out.local.info", "message_content": "{\"msg\": \"Successfully generated auth token for Lark API\", \"time\": \"2024-06-24T02:40:00.213215Z\", \"level\": \"info\", \"collector_name\": \"lark_collector\", \"collector_version\": \"1.0.0\", \"collector_image\": null, \"job_id\": \"not_used\", \"input_name\": \"lark\", \"service_name\": \"audit_infos\", \"module_name\": \"LarkBasePuller\"}"}
2024-06-24T08:10:02.957    INFO InputProcess::LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Remote source is pullable
2024-06-24T08:10:02.958    INFO InputProcess::LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Token is valid. Skipping the generation of new auth token 
2024-06-24T08:10:02.959    INFO InputProcess::LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Token is valid. Skipping the generation of new auth token 
2024-06-24T08:10:02.959    INFO InputProcess::LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Setup for module <LarkBasePuller> has been successfully executed

Puller output

A successful initial run has the following output messages for the puller module:

Note that the PrePull action is executed only one time before the first run of the Pull action.

2024-06-24T08:15:25.789    INFO InputProcess::LarkBasePuller(lark,964383,audit_infos,predefined) -> Pull Started
2024-06-24T08:15:25.790    INFO OutputProcess::ConsoleSender(internal_senders,console_sender_0) -> {"message_timestamp": "2024-06-24 02:45:25.788", "message_tag": "devo.collectors.out.local.warning", "message_content": "{\"msg\": \"Persistence has been updated successfully\", \"time\": \"2024-06-24T02:45:25.788960Z\", \"level\": \"warning\", \"collector_name\": \"lark_collector\", \"collector_version\": \"1.0.0\", \"collector_image\": null, \"job_id\": \"not_used\", \"input_name\": \"lark\", \"service_name\": \"audit_infos\", \"module_name\": \"LarkBasePuller\"}"}
2024-06-24T08:15:25.790    INFO OutputProcess::ConsoleSender(internal_senders,console_sender_0) -> {"message_timestamp": "2024-06-24 02:45:25.789", "message_tag": "devo.collectors.out.local.info", "message_content": "{\"msg\": \"LarkBasePuller(lark,964383,audit_infos,predefined) Finalizing the execution of pre_pull()\", \"time\": \"2024-06-24T02:45:25.789209Z\", \"level\": \"info\", \"collector_name\": \"lark_collector\", \"collector_version\": \"1.0.0\", \"collector_image\": null, \"job_id\": \"not_used\", \"input_name\": \"lark\", \"service_name\": \"audit_infos\", \"module_name\": \"LarkBasePuller\"}"}
2024-06-24T08:15:25.790    INFO OutputProcess::ConsoleSender(internal_senders,console_sender_0) -> {"message_timestamp": "2024-06-24 02:45:25.789", "message_tag": "devo.collectors.out.local.info", "message_content": "{\"msg\": \"Starting data collection every 15 seconds\", \"time\": \"2024-06-24T02:45:25.789388Z\", \"level\": \"info\", \"collector_name\": \"lark_collector\", \"collector_version\": \"1.0.0\", \"collector_image\": null, \"job_id\": \"not_used\", \"input_name\": \"lark\", \"service_name\": \"audit_infos\", \"module_name\": \"LarkBasePuller\"}"}
2024-06-24T08:15:25.791    INFO OutputProcess::ConsoleSender(internal_senders,console_sender_0) -> {"message_timestamp": "2024-06-24 02:45:25.789", "message_tag": "devo.collectors.out.local.info", "message_content": "{\"msg\": \"Pull Started\", \"time\": \"2024-06-24T02:45:25.789572Z\", \"level\": \"info\", \"collector_name\": \"lark_collector\", \"collector_version\": \"1.0.0\", \"collector_image\": null, \"job_id\": \"not_used\", \"input_name\": \"lark\", \"service_name\": \"audit_infos\", \"module_name\": \"LarkBasePuller\"}"}
2024-06-24T08:15:30.372    INFO InputProcess::LarkBasePuller(lark,964383,audit_infos,predefined) -> Retrieved 50 audit_infos event(s)
2024-06-24T08:15:30.376    INFO InputProcess::LarkBasePuller(lark,964383,audit_infos,predefined) -> Sent 50 events

After a successful collector’s execution (that is, no error logs found), you will see the following log message:

2024-06-24T08:19:07.641 INFO InputProcess::LarkBasePuller(lark,964383,audit_infos,predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1719197345217):Number of requests made: 1; Number of events received: 1; Number of duplicated events filtered out: 0; Number of events generated and sent: 1; Average of events per second: 0.414.
 Restart the persistence

This collector uses persistent storage to download events in an orderly fashion and avoid duplicates. In case you want to re-ingest historical data or recreate the persistence, you can restart the persistence of this collector by following these steps:

  1. Edit the configuration file.

  2. Change the value of the initial_start_time_in_utc_value parameter to a different one.

  3. Save the changes.

  4. Restart the collector.

The collector will detect this change and will restart the persistence using the parameters of the configuration file or the default configuration in case it has not been provided.

Note that this action clears the persistence and cannot be recovered in any way. Resetting persistence could result in duplicate or lost events.

 Troubleshooting

This collector has different security layers that detect both an invalid configuration and abnormal operation. This table will help you detect and resolve the most common errors.

Error type

Error ID

Error message

Cause

Solution

InitVariablesError

1

initial_start_time_in_utc is not set as per the datetime_format : {datetime_format}

The date in config is not as per required format

Ensure the date format is correct.

InitVariablesError

2

Date {initial_start_time_str} is in the future

The date in config is greater than current time

Ensure the datetime is less than current time

SetupError

100

HTTP error occurred while generating auth token from Lark server

Wrong credentials

Check the credentials and ensure that the collector has the necessary permissions to access the Lark API.

SetupError

101

Some error occurred while generating auth token from Lark server. Error details: {e}

Generate auth token api failed

Contact the developer with exact error message.

SetupError

102

Unable to generate auth token with status code as {response.status_code}

Generate auth token api failed

Contact the developer with exact error message.

SetupError

103

HTTP Error occurred while fetching audit infos from Lark server

Lark API call is failing

Contact the developer with exact error message.

SetupError

104

Some error occurred while fetching audit infos from Lark server. Error details: {e}

Lark API call is failing

Check the credentials and ensure that the collector has the necessary permissions to access the Lark API.

PullError

300

HTTP error occurred while fetching audit infos from Lark server

Lark API call is failing

Check the credentials and ensure that the collector has the necessary permissions to access the Lark API.

PullError

301

Some error occurred while fetching audit infos from Lark server. Error details: {e}

Lark API call is failing

Contact the developer with exact error message.

Collector operations

This section is intended to explain how to proceed with specific operations of this collector.

 Verify collector operations

Initialization

The initialization module is in charge of setup and running the input (pulling logic) and output (delivering logic) services and validating the given configuration.

A successful run has the following output messages for the initializer module:

2024-06-24T08:27:31.886    INFO InputProcess::MainThread -> Process Started
2024-06-24T08:27:31.945    INFO InputProcess::MainThread -> LarkBasePuller(lark,964383,audit_infos,predefined) Starting the execution of init_variables()
2024-06-24T08:27:31.946    INFO InputProcess::MainThread -> Validating service metadata
2024-06-24T08:27:31.949    INFO InputProcess::MainThread -> Validating defined module definition
2024-06-24T08:27:31.956    INFO InputProcess::MainThread -> Validating common input config
2024-06-24T08:27:31.959    INFO InputProcess::MainThread -> Validating service input config
2024-06-24T08:27:31.961    INFO InputProcess::MainThread -> Running overriding rules
2024-06-24T08:27:31.961    INFO InputProcess::MainThread -> Overriding rule #1 - service key <override_tag> with value <my.app.lark.audit_test> overrides definition key <tag> with value <None> when the first is not <None>
2024-06-24T08:27:31.961    INFO InputProcess::MainThread -> Validating the rate limiter config given by the user
2024-06-24T08:27:31.961    INFO InputProcess::MainThread -> <requests_limits> setting has not been defined. The generic settings will be used instead.
2024-06-24T08:27:31.962    INFO InputProcess::MainThread -> Adding raw config to the collector store
2024-06-24T08:27:31.962    INFO InputProcess::MainThread -> Running custom validation rules
2024-06-24T08:27:31.965    INFO InputProcess::MainThread -> Creating API client.
2024-06-24T08:27:31.965    INFO InputProcess::MainThread -> Created request client: <agent.modules.lark.commons.lark_client.LarkClient object at 0x7796c07f8e50>
2024-06-24T08:27:31.965    INFO InputProcess::MainThread -> LarkBasePuller(lark,964383,audit_infos,predefined) Finalizing the execution of init_variables()
2024-06-24T08:27:31.967    INFO InputProcess::MainThread -> InputThread(lark,964383) - Starting thread (execution_period=60s)
2024-06-24T08:27:31.968    INFO InputProcess::MainThread -> ServiceThread(lark,964383,audit_infos,predefined) - Starting thread (execution_period=60s)
2024-06-24T08:27:31.968    INFO InputProcess::MainThread -> LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Starting thread
2024-06-24T08:27:31.968    INFO InputProcess::MainThread -> LarkBasePuller(lark,964383,audit_infos,predefined) - Starting thread
2024-06-24T08:27:31.968    INFO OutputProcess::MainThread -> DevoSender(standard_senders,devo_sender_0) -> Starting thread
2024-06-24T08:27:31.969 WARNING InputProcess::LarkBasePuller(lark,964383,audit_infos,predefined) -> Waiting until setup will be executed

Events delivery and Devo ingestion

The event delivery module is in charge of receiving the events from the internal queues where all events are injected by the pullers and delivering them using the selected compatible delivery method.

A successful run has the following output messages for the initializer module:

2024-06-24T08:40:34.130    INFO OutputProcess::ConsoleSenderManagerMonitor(standard_senders,console_1) -> Number of available senders: 1, sender manager internal queue size: 0
2024-06-24T08:40:34.130    INFO OutputProcess::ConsoleSenderManagerMonitor(standard_senders,console_1) -> enqueued_elapsed_times_in_seconds_stats: {}
2024-06-24T08:40:34.130    INFO OutputProcess::ConsoleSenderManagerMonitor(standard_senders,console_1) -> Sender: ConsoleSender(standard_senders,console_sender_0), status: {"internal_queue_size": 0, "is_connection_open": True}
2024-06-24T08:40:34.131    INFO OutputProcess::ConsoleSenderManagerMonitor(standard_senders,console_1) -> Standard - Total number of messages: 667 messages/bytes sent since/to "2024-06-24T03:05:34.119248+00:00/2024-06-24T03:10:34.131023+00:00": 667/1942773, (elapsed 0.078 seconds)
2024-06-24T08:40:34.131    INFO OutputProcess::ConsoleSenderManagerMonitor(standard_senders,console_1) -> Output metric sent
2024-06-24T08:40:34.132    INFO OutputProcess::ConsoleSenderManagerMonitor(internal_senders,console_1) -> Number of available senders: 1, sender manager internal queue size: 0
2024-06-24T08:40:34.132    INFO OutputProcess::ConsoleSenderManagerMonitor(internal_senders,console_1) -> enqueued_elapsed_times_in_seconds_stats: {}
2024-06-24T08:40:34.133    INFO OutputProcess::ConsoleSenderManagerMonitor(internal_senders,console_1) -> Sender: ConsoleSender(internal_senders,console_sender_0), status: {"internal_queue_size": 0, "is_connection_open": True}
2024-06-24T08:40:34.133    INFO OutputProcess::ConsoleSenderManagerMonitor(internal_senders,console_1) -> Internal - Total number of messages: 205 messages/bytes sent since/to "2024-06-24T03:05:34.127673+00:00/2024-06-24T03:10:34.133181+00:00": 205/84900, (elapsed 0.045 seconds)

By default, these information traces will be displayed every 10 minutes.

Sender services

The Integrations Factory Collector SDK has 3 different senders services depending on the event type to delivery (internal, standard, and lookup). This collector uses the following Sender Services:

Sender services

Description

internal_senders

In charge of delivering internal metrics to Devo such as logging traces or metrics.

standard_senders

In charge of delivering pulled events to Devo.

Sender statistics

Each service displays its own performance statistics that allow checking how many events have been delivered to Devo by type:

Logging trace

Description

Number of available senders: 1

Displays the number of concurrent senders available for the given Sender Service.

sender manager internal queue size: 0

Displays the items available in the internal sender queue.

This value helps detect bottlenecks and needs to increase the performance of data delivery to Devo. This last can be made by increasing the concurrent senders.

Total number of messages sent: 44, messages sent since "2022-06-28 10:39:22.511671+00:00": 21 (elapsed 0.007 seconds)

Displays the number of events from the last time and following the given example, the following conclusions can be obtained:

  • 44 events were sent to Devo since the collector started.

  • The last checkpoint timestamp was 2022-06-28 10:39:22.511671+00:00.

  • 21 events where sent to Devo between the last UTC checkpoint and now.

  • Those 21 events required 0.007 seconds to be delivered.

 Check memory usage

To check the memory usage of this collector, look for the following log records in the collector which are displayed every 5 minutes by default, always after running the memory-free process.

  • The used memory is displayed by running processes and the sum of both values will give the total used memory for the collector.

  • The global pressure of the available memory is displayed in the global value.

  • All metrics (Global, RSS, VMS) include the value before freeing and after previous -> after freeing memory

2023-11-10T09:57:53.856    INFO InputProcess::MainThread -> [GC] global: 39.1% -> 39.1%, process: RSS(68.84MiB -> 68.84MiB), VMS(503.30MiB -> 503.30MiB)
2023-11-10T09:58:53.862    INFO OutputProcess::MainThread -> [GC] global: 39.1% -> 39.1%, process: RSS(49.12MiB -> 49.12MiB), VMS(928.57MiB -> 928.57MiB)

Differences between RSS and VMS memory usage:

  • RSS is the Resident Set Size, which is the actual physical memory the process is using

  • VMS is the Virtual Memory Size which is the virtual memory that process is using

Change log

Release

Released on

Release type

Details

Recommendations

v1.0.0

INITIAL VERSION


-

-

  • No labels