RSS

How I Passed the Databricks Data Engineer Associate Certification in Three Weeks

How I Passed the Databricks Data Engineer Associate Certification in Three Weeks

I recently decided to take the Databricks Data Engineer Associate certification and managed to pass the exam in just three weeks.

Why Databricks?

About a week into the Junior Data Engineer course I’m currently taking, I realized that earning a certification would be beneficial. I quickly chose Databricks over AWS or Azure Fabric. Databricks felt more cloud‑agnostic since it runs on both AWS and Azure, and I found its interface far cleaner compared to Azure’s sprawling ecosystem and confusing Fabric/Power BI UI.

Unlike many cloud certifications where you can pass with brain dumps and never touch the platform, Databricks requires hands‑on experience with ingestion and transformation. If you already have a solid foundation in Python, Pandas, intermediate SQL, Git, and CI/CD pipelines, the learning curve is manageable. The main additions are PySpark, Delta tables, live streaming with Autoloader, DAB files, and CDC/SCD concepts.

Study Resources

I used Udemy’s Databricks Certified Data Engineer Associate – Ultimate Prep by Ramesh Retnasamy as my main resource as I have paid subscription. It includes practical examples for ingesting JSON, JDBC, cloud storage, and binary formats, plus managing live streaming tables with Autoloader and SCD tables with CDC. It also emphasizes switching between SQL and PySpark and running pipelines with live tables.

For practice exams, I relied on the official Databricks AI exam prep guide, Udemy’s practice exams, Examtopics (I stopped at 50 questions as I wasn’t prepared to pay another USD 79 for subscription after forking out 200 USD for the exam), and sites like Bricksnotes and Open Exam Prep. Practice exams help, but I don’t think they cover enough for the exams.

Note: I am not sure if Examtopics has enough questions covered with 200+ questions as I didn’t not subscribe to get them

My Exam Experience

The exam covered a wide range of topics, and while I scored strongly in areas like data transformation, Lakeflow jobs, troubleshooting, and governance, I was surprised by a lower score in CI/CD (but it could also be that it has a lower percentage of questions). Below are my scores:

Databricks Intelligence Platform: 33%
Development and Ingestion: 66%
Data Transformation and Modeling: 100%
Working with Lakeflow Jobs: 100%
Implementing CI/CD: 60%
Troubleshooting, Monitoring, and Optimization: 100%
Governance and Security: 100%

Some questions were tricky. For example, one asked how to cast a string to an integer without raising errors, returning null instead. The options included INT(), CAST(), COALESCE(), and TRY_CAST(). Knowing SQL well, I recognized the first three wouldn’t work — leaving TRY_CAST() as the correct answer. I hadn’t seen that function before, but familiarity with the others helped me deduce it. This is why you should a good pandas, PySpark and SQL foundation.

If you intend to take the exam

Beyond the core study path, I recommend to focus additionally on:

  • Understanding different compute options and autoscaling configurations
  • Learning how DAB files are called, and how parameters and variables are used
  • Being comfortable with Autoloader, COPY INTO, and MERGE INTO, especially handling different schema changes

Final thought: The Databricks exam is more practical than many cloud certifications. If you prepare with hands‑on practice, not just dumps, you’ll be well positioned to succeed. Good luck with your exams.

 
Leave a comment

Posted by on September 12, 2026 in Python, Data Engineering

 

Tags: , , , , , ,

The Importance of Documentation in IT Operations

The Importance of Documentation in IT Operations


I’m writing this from my own experience in IT Operations, but I’d bet it’s relatable for anyone in tech.

What’s the most frustrating thing about joining a new team or company?

It’s probably not the tech itself. It’s figuring out how everything around it works.

How do you request credentials? Raise a VM for development? What privileges does your account need, and where do you go to ask? Even if you’re good with Windows or Linux, do you actually know how SSH keys, certs, and sudo privileges work in this company’s setup?

Most new joiners spend 6 months or more just trying to make sense of the tech and infra stack. Asking colleagues how things are done. Chasing other teams for info on how to connect to this system or that one. Because the wiki either doesn’t make sense, or it doesn’t exist.

Most companies treat documentation like archaeology. It’s supposed to be there, but it’s long forgotten, and you have to dig it up yourself to make sense of anything. But documentation should be a living record of what’s current, not a relic.

Why does this happen? The industry is obsessed with technical skills. Get 100 certs, get hands-on with 1000 tools, and you’re set. Almost no time goes into training people to document, and almost no manager demands it, whether that’s during an incident or as part of daily work. You’re rarely appraised for a lack of documentation. You’re praised for the number of projects you shipped, even if the documentation sucks and the maintenance team curses your name.

“If we forget our past, we are doomed to repeat the same mistakes.” That’s exactly what happens with bugs nobody wrote down, they come back to bite you. I’ve seen storage optimization settings get silently reverted after an upgrade, not every time, just often enough to catch you off guard.

Here’s the part nobody talks about: creating something is maybe 20% of its lifecycle, think installing a new cloud stack. Maintaining it is the other 80%. But appraisal systems reward the shipped thing. Managers rarely stop to think about how painful that thing will be to maintain for the rest of its life.

Documentation should be a required soft skill in every team’s culture. Writing docs well is a hard skill. But the attitude of writing things down so others can use it later, that’s a behavioral skill, and it’s basically never appraised.

“Knowledge sharing” as a value is too vague. It can mean a mention in a meeting or a quick summary email. Neither of those is structured knowledge, and structured knowledge is what teams need to make maintenance, 80% of the lifecycle, productive instead of a scramble.

So here’s my ask: managers, make documentation part of how you appraise your team; get the maintenance team to appraise. Engineers, write it down anyway, even if nobody’s asking. The next person navigating your systems, maybe even future you, will thank you for it.

What’s your experience been?

 
Leave a comment

Posted by on July 29, 2026 in Operations, Peopleware

 

Tags: ,

Python Type Annotations: The “Safety Brakes” We Forgot to Teach

Python Type Annotations: The “Safety Brakes” We Forgot to Teach

I’ve been diving into several AI and Data Analytics courses recently, and I’ve noticed a recurring issue in how we teach Python. Even at advanced levels, there is almost zero emphasis on Type Annotation. While type hinting was introduced to the language way back in 2018, many online instructors still treat it as if it doesn’t exist. This neglect is exactly why we are still talking about “spaghetti code” and unmaintainable systems nearly a decade after the tools to prevent them were made available.

I know Python is a dynamically typed language, but it has never made sense to me to recast a variable—like movement_counter—from an integer to a string mid-way through the code. That should be two different variables, not one. Reusing a variable for a different type usually highlights that the variable isn’t correctly named or the logic is flawed. While there are rare exceptions to the rule, that is exactly where comments should be used to explain the “why.”

Safety should never be an afterthought or something you learn “when you have the time.” In any other engineering discipline, you don’t learn how to build a machine and then learn about the safety brakes later. Type safety should be embedded in the learning process itself. Type hints are very important in helping you debug your code, especially when it grows exponentially large over time. Even if a learner only intends to write small scripts, those scripts still need to be readable, predictable, and easy to maintain six months down the line. Type annotations serve as live, functional documentation that removes the “guessing game” from what a function accepts or returns.

Python is one of the most widely used languages in the world; instructors should stop teaching people how to write code that just “runs.” Start teaching them how to write code that lasts. Type hints aren’t a luxury or an optional add-on—they are the foundation of professional, reliable Python development.

Type annotation should be emphasized from Day 1 of learning Python.

Consider this standard AI agent implementation. It looks functional, but it lacks intent. For instance, why does results_paginator require a nested loop into an empty list? And once create_openai_tools_agent returns, what is the resulting agent interface? Without type hints, you’re forced to treat the library as a black box, relying on trial-and-error or external documentation rather than your IDE’s intelligence.

import...

load_dotenv()

todoist_api_key = os.getenv("TODOIST_API_KEY")
gemini_api_key = os.getenv("GEMINI_API_KEY")

todoist = TodoistAPI(todoist_api_key)

@tool
def add_task(task, description):
   """
   Add a new task to the user's task list. Use this when the user want to add or create a new task.
   """
   todoist.add_task(content=task,
                    description=description)
   return f"Successfully added task: {task}"

@tool
def show_task():
    """
    Show all task from Todoist. Use this tool when the user want to show all tasks from Todoist.
    """
    results_paginator = todoist.get_tasks()
    tasks = []
    for task_list in results_paginator:
        for task in task_list:
            tasks.append(task.content)
    return tasks

def main():

   tools = [add_task, show_task]

   llm = ChatGoogleGenerativeAI(
       model='gemini-2.5-flash',
       google_api_key=gemini_api_key,
       temperature=0.3
   )

   system_prompt = """You are a helpful assistant capable of managing tasks and answering general questions.
   If the user asks about tasks, use the provided tools. 
   If the user asks general questions (like 'what is a car'), answer them directly using your internal knowledge.
   Format task lists as bullet points."""

   prompt  = ChatPromptTemplate([
       ("system", system_prompt),
       MessagesPlaceholder("history"),
       ("user", "{input}"),
       MessagesPlaceholder("agent_scratchpad")
   ])

   # Finally create AI agent
   agent = create_openai_tools_agent(llm, tools, prompt)
   agent_executor= AgentExecutor(agent=agent, tools=tools, verbose=False)

   # History required to remember previous questions
   history: = []

   print("Type 'exit', 'quit', 'bye' to stop.")
   while True:
       user_input = input("You: ")

       if user_input.lower() in ["exit", "quit", "bye"]:
           print("Assistant: Goodbye! Have a great day.")
           break

       # limit history to last 10 to prevent hitting free tier limit
       response = agent_executor.invoke({"input": user_input, "history": history[-10:]})
       print(response['output'])
       history.append(HumanMessage(content=user_input))
       history.append(AIMessage(content=response['output']))


if __name__ == "__main__":
   main()

With type annotation, it becomes very clear what each variable represents and how to interact with them.

Think of type hints as live, inline documentation that never goes out of date. Instead of digging through the Todoist API source code to see if get_tasks() returns a string or a list, the signature tells you it’s an Iterator[List] immediately. This clarity extends to complex frameworks like LangChain, where seeing a Runnable return type tells you exactly which methods (like .invoke() or .stream()) are available. It makes the code self-explanatory and significantly lowers the barrier for new contributors.

import...

load_dotenv()

todoist_api_key: str = os.getenv("TODOIST_API_KEY")
gemini_api_key: str = os.getenv("GEMINI_API_KEY")

todoist: TodoistAPI = TodoistAPI(todoist_api_key)

@tool
def add_task(task: str, description: str) -> str:
   """
   Add a new task to the user's task list. Use this when the user want to add or create a new task.
   """
   todoist.add_task(content=task,
                    description=description)
   return f"Successfully added task: {task}"

@tool
def show_task() -> list[str]:
    """
    Show all task from Todoist. Use this tool when the user want to show all tasks from Todoist.
    """
    results_paginator: Iterator[List] = todoist.get_tasks()
    tasks: list[str] = []
    for task_list in results_paginator:
        for task in task_list:
            tasks.append(task.content)
    return tasks

def main() -> None:

   tools: List[Any] = [add_task, show_task]

   llm: ChatGoogleGenerativeAI = ChatGoogleGenerativeAI(
       model='gemini-2.5-flash',
       google_api_key=gemini_api_key,
       temperature=0.3
   )

   system_prompt: str = """You are a helpful assistant capable of managing tasks and answering general questions.
   If the user asks about tasks, use the provided tools. 
   If the user asks general questions (like 'what is a car'), answer them directly using your internal knowledge.
   Format task lists as bullet points."""

   prompt: ChatPromptTemplate = ChatPromptTemplate([
       ("system", system_prompt),
       MessagesPlaceholder("history"),
       ("user", "{input}"),
       MessagesPlaceholder("agent_scratchpad")
   ])

   # Finally create AI agent
   agent: Runnable[dict, Any] = create_openai_tools_agent(llm, tools, prompt)
   agent_executor: AgentExecutor = AgentExecutor(agent=agent, tools=tools, verbose=False)

   # History required to remember previous questions
   history: list[Any] = []

   print("Type 'exit', 'quit', 'bye' to stop.")
   while True:
       user_input: str = input("You: ")

       if user_input.lower() in ["exit", "quit", "bye"]:
           print("Assistant: Goodbye! Have a great day.")
           break

       # limit history to last 10 to prevent hitting free tier limit
       response: dict[str, Any] = agent_executor.invoke({"input": user_input, "history": history[-10:]})
       print(response['output'])
       history.append(HumanMessage(content=user_input))
       history.append(AIMessage(content=response['output']))


if __name__ == "__main__":
   main()

 
Leave a comment

Posted by on March 13, 2026 in Python

 

Tags: , , ,

Frustrating fishing attempts from recruitment agencies

Now that my non-disclosure clauses have expired, I can finally share that I was retrenched last year. Since then, I’ve been receiving frequent calls and messages from recruitment agencies.

For those outside of Singapore, this high volume is often tied to local hiring guidelines; companies are encouraged to prioritize local talent before expanding their search. While it’s great to be in the “search pool,” it doesn’t necessarily mean I’m a “top talent”—it often means I’m part of a wide net being cast.

On the surface, it sounds like a great position to be in. In reality? It’s often just a “fishing” exercise. 🎣

It is frustrating to be disturbed on my holidays by calls for roles that clearly don’t align with my background. I appreciate being considered, but it’s a waste of time for everyone when a recruiter hasn’t even glanced at my CV.

To protect my time (and theirs), my approach is now very simple:

Me: “Thanks for reaching out. What specific experience in my resume made you feel I’d be a fit for this job description?”

If they’ve done their homework, it’s the start of a great conversation. If they haven’t, it saves us both a 20-minute phone call. 🎯

I hope recruitment agencies read this.

 
Leave a comment

Posted by on March 13, 2026 in General

 

Revisiting an old friend: dBASE

I was looking at old folder that I have kept and found an old dBASE problem that I wrote and sold to my supplier in 1994. I was working as a Test Engineer in a manufacturing plant, and we have a close relationship with our supplier. During those years just just before Windows 3.11 came around, we all running DOS and I was already writing dBase programs for my company, i.e. quality records and ISO standard referencing.

Basically, my supplier needed a simple program to keep track of their customers, stock, delivery orders and invoices. The final product as EasyInv.exe written in dBASE IV. I took it out for a spin on DosBox and unsurprising, it worked as well as I left it. Anyway, I uploaded the source code below if anyone is interested in looking that them.

Source: https://github.com/kwongheng/dbase_retsys

 
Leave a comment

Posted by on January 30, 2026 in Develop

 

Tags:

MySQL Unique Constraint Trick: Enforce “Only One Active Loan Record” Using NULL (Spring Boot JPA Pattern)

Disclaimer: During my capstone project, I had to design a Library Management System with Spring Boot and MySQL database. This issue was one of the bumps in the road that I struggled with despite using Grok. At the end, I had to tell Grok the correct logic instead because it was fumbling. The summary below is written by Grok based on our shared troubleshooting experience. What is interesting is that while asking Grok to write this post, it still got the logic incorrect, which was corrected.

Introduction to the Issue

In many applications — library systems, equipment rentals, hotel bookings, subscription services, or any domain with temporary assignments — we need a business rule like:

A user/entity can have only one active (ongoing) relationship with another entity at a time.

Examples:

  • A member can borrow a specific book only once while it’s not returned.
  • A customer can rent a particular car only if it’s currently available (not rented).
  • A user can have only one active subscription per product.

To enforce this at the database level (for data integrity, even outside the app), developers often try adding a unique constraint involving a status flag (e.g., isActive, isReturned, isRented).

But naive implementations lead to unexpected Duplicate entry errors when trying to re-activate a previously ended relationship.

This post explains the common pitfalls and presents a generic, reusable pattern that works reliably in MySQL + Spring Boot JPA.

Common Attempts and Why They Fail

1. Using primitive boolean + value false for “active”

In Java:

private boolean isActive = true;  // true = active

In MySQL -> Unique constraint:

UNIQUE (entity_a_id, entity_b_id, isActive)

Problem: When the record is deactivated (isActive = false), the row still exists with (user_id, item_id, false). Trying to create a new active one (true) is allowed — but if you later want to re-activate the same pair, you’re blocked because (user_id, item_id, true) already existed historically.

Worse: multiple active records become possible if logic flips the flag incorrectly.

2. Using boolean with false for active

Same as above but inverted — still fails because historical rows block new active ones.

3. Using numeric types like BIGINT or INT with counters

Idea: use a sequence number per reactivation.

Why it fails:

  • Adds unnecessary complexity.
  • Requires application logic to manage counters.
  • Not intuitive or self-documenting.
  • Prone to bugs (off-by-one, concurrency issues).

4. Partial/Filtered Unique Indexes

PostgreSQL supports:

CREATE UNIQUE INDEX ON table(entity_a_id, entity_b_id) WHERE is_active = true;

Why it doesn’t work in MySQL: MySQL only gained functional indexes and partial indexes in version 8.0.21+, and the syntax is not as clean or widely supported in older versions or some hosting providers.

Not portable if you’re stuck on MySQL 5.7 or early 8.x.

The Generic Solution

Core Idea: Use NULL to Represent “Active”, and a Non-Null Value for “Completed”

Exploit MySQL’s unique constraint behavior with NULL:

  • Multiple rows with status = NULL are allowed (MySQL treats NULLs as distinct for uniqueness).
  • Multiple rows with the same non-NULL value are blocked.

To get “only one active”:

  • Active → non-null value (e.g., false or 0)
  • Completed → NULL

MySQL Constraint:

UNIQUE (entity_a_id, entity_b_id, status)

Result: Exactly one active (FALSE) record at a time, unlimited completed historical records (NULL).

Generic Implementation in Spring Boot JPA

@Entity
@Table(
    uniqueConstraints = @Unique(
        name = "uk_only_one_active",
        columnNames = {"entityA_id", "entityB_id", "status"}
    )
)
public class TemporaryAssignment {  // Rename to Borrow, Rental, Booking, SubscriptionActivation, etc.

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne
    private EntityA entityA;  // e.g., User, Customer

    @ManyToOne
    private EntityB entityB;  // e.g., Book, Car, Room

    @Column(nullable = true)  // Critical!
    private Boolean status;   // false = active/ongoing, null = completed

	public void setStatus(boolean active) {   // required to set the correct logic
	    this.isActive = active ? false: null
	}

    private LocalDateTime startDate;
    private LocalDateTime endDate;  // Optional: populate on completion
}

References

 
Leave a comment

Posted by on December 22, 2025 in java

 

Tags: , , , , ,

How to Mock SweetAlert2 (Swal.fire) in Jest + React Testing Library

Disclaimer: I asked Grok to write this out for me, as I am not really highly experienced REACT Jest or RTL tester. I was working on my capstone project as a full-stack developer and was working on test scripts where my react/js codes uses Swal (SweetAlert2). I spent almost 2-3 days working with AI trying to figure out why we could not simulate the button clicks with AI constantly recommended well-known solutions that didn’t work and it went on in circles tell I forced AI to think out of the box.

Introduction to the Issue

When writing unit tests for React components using Jest and React Testing Library, everything often goes smoothly until you hit a component that uses SweetAlert2 (Swal.fire) for confirmations, success messages, or errors.

The problem: Tests that involve await Swal.fire(...) hang indefinitely or fail with timeouts. The code after the await (e.g., refreshing a table, resetting a form, navigating, or updating state) never executes, causing assertions to fail.

This happens because the real Swal.fire() opens a DOM modal that waits for user interaction. In Jest’s jsDOM test environment (no real browser UI), no one can click “OK” or “Cancel” — so the promise returned by Swal.fire() never resolves. Execution stops forever at the await.

Early tests (e.g., validation, API errors) pass fine because they don’t reach the modal. But any test simulating a successful action (add/update/delete with confirmation) turns red.

What We Tried and Why It Failed

Common attempts people (including Grok) try:

1. Spying on Swal.fire without mocking the return value:

    jest.spyOn(Swal, 'fire');
    

    → You can assert it was called, but the promise still hangs — code after await never runs.

    2. Mocking with a synchronous return

    Swal.fire = jest.fn(() => ({ isConfirmed: true }));
    

    → The await still expects a Promise. In many cases it “works” but it’s fragile and doesn’t match SweetAlert2’s real async behavior.

    3. Using manual mocks in mocks/sweetalert2.js

    → Often overkill, and if not set to return a resolving Promise, same hanging issue.

    4. Mocking window.confirm instead

    → SweetAlert2 doesn’t use window.confirm — irrelevant.

      These fail because they don’t properly replicate SweetAlert2’s async Promise-based API. The test environment needs the promise to resolve immediately so subsequent code executes and assertions can check the updated DOM/state.

      What Finally Worked

      The fix is a single-line module mock that replaces Swal.fire with a Jest mock returning a resolved Promise mimicking a user clicking “Confirm”:

      // Usually in setupTests.js or at the top of your test file
      jest.mock('sweetalert2', () => ({
        fire: jest.fn().mockResolvedValue({ isConfirmed: true }),
      }));
      

      Or, if you import as default Swal:

      import Swal from 'sweetalert2';
      
      jest.mock('sweetalert2', () => ({
        default: {
          fire: jest.fn().mockResolvedValue({ isConfirmed: true }),
        },
      }));
      

      Why This Works

      • jest.fn() creates a mock function you can assert on (e.g., expect(Swal.fire).toHaveBeenCalledWith(...)).
      • .mockResolvedValue({ isConfirmed: true }) makes Swal.fire() return a Promise that immediately resolves with the exact object SweetAlert2 returns on confirm.
      • The await Swal.fire(...) now resolves instantly.
      • Code after the await (table refresh, query invalidation, state updates) runs immediately.
      • DOM updates happen → your screen.findByText(...) or expect(queryByText(...)).not.toBeInTheDocument() assertions pass.

      Bonus variations:

      • For cancel/dismiss: .mockResolvedValue({ isDismissed: true })
      • For different tests: Use .mockResolvedValueOnce(...) to return different values per call.

      Using mockResolvedValue (instead of plain return) is better because it preserves the Promise nature — safer and closer to real behavior.

      References

      • Stack Overflow: How can I mock sweetalert2 in Jest? — Multiple answers showing mockResolvedValue({ isConfirmed: true }).
      • Jest Docs: Mock Functions — Explains mockResolvedValue.
      • SweetAlert2 GitHub Issues: Discussions around Jest compatibility (e.g., #1426).
      • Common pattern seen in many React Testing Library examples.
       
      Leave a comment

      Posted by on December 22, 2025 in Javascript

       

      Tags: , , , , , , , , , ,

      On work life balance and late meetings working in Asia

      I made the following comments for this post in LinkedIn as a follow up to my own post in LinkedIn about late meetings previously:

      “The lack of work-life balance doesn’t just hit traders—it affects everyone in a global company’s Asia side. Nobody seems to talk about how constant late-night calls mess with the quality of life for employees in Asia. The default assumption seems to be that those in Asia have to sacrifice their social lives, time with family, friends, sports, or even “me time” for the company’s sake. Meanwhile, this kind of sacrifice isn’t expected from folks in the EU or U.S., where global meetings conveniently wrap up by the end of their workday.

      In engineering, if you don’t set clear requirements—like ensuring Asia-based employees get the same work-life balance as their EU/U.S. counterparts—the solution will not be equitable. Are workers in the EU or U.S. seen as more valuable, so Asian employees have to give up more for the firm? Does this reflect some outdated colonial mindset? It’s worth some serious soul-searching to figure out why this imbalance persists.”

       
      Leave a comment

      Posted by on September 2, 2025 in Peopleware

       

      Terraform files for quick demo or testing of prometheus/grafana on AWS

      I have created a set of terraform files to quickly deploy instances of Prometheus and Grafana server with a node exporter. This is useful for you if you are learning prom/grafana combo but don’t have too much resources to run dockers or VMs on your own desktop, but you have the free-tier AWS account. Do remember to destroy all resources when you are done testing to avoid charges. You can grab them from the github link below:

      https://github.com/kwongheng/terraformaws_promgraf

       
      Leave a comment

      Posted by on August 17, 2025 in IaC

       

      Tags: , , , ,

      Getting docker containers to talk to each other internally

      I am writing this post as a newbie working on docker and stuff like Prometheus. This is a cumulation of my own discovery which took me no less than 2 days to get everything right. Hence, I decided to put this in one place for future reference and any struggling newbie.

      The main issue I was getting with docker and Prometheus is that it was not able to scrap metrics from another docker container. The main issue is that in a docker container, localhost refers to the docker internal network, not the network on your desktop. To ensure that your docker containers talk to each other, they must be on the same network. Since, I am using a docker compose file to create the Prometheus/Grafana containers, I will use the same network defined in that file.

      # network defined in docker-compose.yml
      .....
      networks:
        monitoring:
          external: true
      
      # before running the file, create the network
      docker create network monitoring
      
      # create the containers
      docker compose -f docker-compose.yml up -d
      
      # my own additional learning, to recreate broken containers using compose file
      docker compose -f docker-compose.yml --force-recreate up -d
      
      # create the other container in the same network
      docker run -d --network monitoring --name test1 -p 5000:5000 image1
      
      # in the prometheus.yml file scrap config, use the container name
      
         - job_name: "app1"
             - static_configs:
                  - targets: ["test1:5000"]
      
      

       
      Leave a comment

      Posted by on August 4, 2025 in Cloud

       

      Tags: , , , ,

       
      Create your own website, free on WordPress.com.Create your own website.
      Start free