Skip to content

Pausing/unpausing and suppressing certain notifications on the fly #35

@macdis

Description

@macdis

I've been using Dolce for a year or more now. It's great. However, there's one thing I can't seem to get it to do.

I have it running 24/7 but when I run a certain maintenance task, scripted in bash and manipulating other containers, I have to pause/unpause or stop/unstop these other containers. This maintenance task is short, but runs hourly, and I don't want Dolce to notify me about the containers starting, stopping, becoming healthy etc.

What I would like to do is disable Dolce briefly, run the maintenance task, and then re-enable Dolce without getting any messages like:

10:25:20 PM                         
 health_status: healthy container_a
10:25:20 PM                         
 health_status: healthy container_b
10:25:20 PM                         
 health_status: healthy container_c

Here is what I have tried in order to disable/re-enable Dolce briefly:

DOLCE_BLACKOUT_WINDOWS='00:00-23:59' DOLCE_EVENTS='die' docker compose -f "$main_compose_file" up -d dolce 2>&1
docker compose -f "$main_compose_file" pause container_a container_b container_c 2>&1
[do some stuff]
docker compose -f "$main_compose_file" unpause container_a container_b container_c 2>&1
DOLCE_BLACKOUT_WINDOWS='' DOLCE_EVENTS='' docker compose -f "$main_compose_file" up -d dolce 2>&1

This does not work as intended. Dolce still sends the above health_status messages when it comes back up.

I should mention that I don't get messages about Dolce itself because I run it with

    labels:
      - dolce.disabled=true

In my compose.yaml I have also set the following so that the environment variables are available within the container.

    environment:
      - DOLCE_EVENTS=${DOLCE_EVENTS:-start,die,kill,oom,stop,pause,unpause,health_status}
      - DOLCE_BLACKOUT_WINDOWS=${DOLCE_BLACKOUT_WINDOWS:-}

A couple of notes:

  1. DOLCE_EVENTS=${DOLCE_EVENTS:-start,die,kill,oom,stop,pause,unpause,health_status} doesn't refer to anything in my .env file. I just included it so the variable would be available in the container, and so that the default options would apply in post-maintenance circumstances.
  2. I put DOLCE_EVENTS='die' in the docker compose command simply so that the environment variable wouldn't be empty, which would apply the default options as per my previous point.

The result, in any case, is that I can't seem to get Dolce to suppress the health_status messages mentioned above. I don't want to disable them globally, just in this one case.

Is there a way to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions